xrdp-0.9.12/000755 001751 001751 00000000000 13601646134 012504 5ustar00metameta000000 000000 xrdp-0.9.12/mc/000755 001751 001751 00000000000 13601646133 013102 5ustar00metameta000000 000000 xrdp-0.9.12/file-loc.txt000644 001751 001751 00000001744 13601643631 014744 0ustar00metameta000000 000000 default build will install the following /usr/local/lib/xrdp libcommon.so libmc.so libscp.so libvnc.so libxrdp.so libxrdpapi.so libxup.so /usr/local/bin xrdp-dis xrdp-genkeymap xrdp-keygen xrdp-sesadmin xrdp-sesrun /usr/local/sbin xrdp xrdp-sesman xrdp-sessvc xrdp-chansrv /etc/xrdp km-xxxxxxxx.ini sesman.ini rsakeys.ini startwm.sh xrdp.ini xrdp_keyboard.ini /etc/xrdp/pulse default.pa /etc/pam.d xrdp-sesman /usr/local/share/man/man1 xrdp-dis.1 /usr/local/share/man/man5 sesman.ini.5 xrdp.ini.5 /usr/local/share/man/man8 xrdp-chansrv.8 xrdp-genkeymap.8 xrdp-keygen.8 xrdp-sesadmin.8 xrdp-sesman.8 xrdp-sesrun.8 xrdp-sessvc.8 xrdp.8 /usr/local/share/xrdp ad24b.bmp ad256.bmp cursor0.cur cursor1.cur sans-10.fv1 xrdp24b.bmp xrdp256.bmp xrdp_logo.bmp when running, the following are created and written to /var/run xrdp.pid sesman.pid /var/log xrdp.log xrdp-sesman.log /tmp/.xrdp xrdp* xrdp-0.9.12/COPYING000644 001751 001751 00000024224 13544635323 013547 0ustar00metameta000000 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.9.12/postinstall-pak000644 001751 001751 00000000732 13544635323 015562 0ustar00metameta000000 000000 #!/bin/sh -e if ! ([ "$1" = "configure" ] || [ "$1" = "reconfigure" ]); then exit 0 fi XRDP="xrdp" ADDUSER="/usr/sbin/adduser" XRDPLOG="/var/log/xrdp-sesman.log" SESMANLOG="/var/log/xrdp-sesman.log" [ -d /var/run/xrdp ] || mkdir -p /var/run/xrdp $ADDUSER --system --disabled-password --disabled-login --home /var/run/xrdp \ --no-create-home --quiet --group $XRDP touch $SESMANLOG $XRDPLOG chown $XRDP:$XRDP $SESMANLOG chown $XRDP:$XRDP $XRDPLOG #DEBHELPER# xrdp-0.9.12/ltmain.sh000644 001751 001751 00001170771 13601646122 014337 0ustar00metameta000000 000000 #! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 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.6 package_revision=2.4.6 ## ------ ## ## 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=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 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. # 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. # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## 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 # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # 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 ## ------------------------- ## ## 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" ## ----------------- ## ## 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_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_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_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg 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. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # 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_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_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_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_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 # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 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. # 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## 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 '# warranty; '. # # 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 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 # to the main code. A hook is just a named list of of function, 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 functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is 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 funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # 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=: ;; # # 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 # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # 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_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse 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 [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_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 propogate 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+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # 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+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break 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 ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # 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+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## 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#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' 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. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # 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: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # 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.6 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= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _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; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } 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_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_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_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_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_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_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 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 -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_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_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_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_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_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$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\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $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_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in 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 ;; 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*) # 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*) # 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 ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-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_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # 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 # -stdlib=* select c++ std lib with clang -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=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_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_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_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_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test 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|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) 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*) # 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_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test 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_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test 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_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do 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_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` 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.9.12/tcutils/000755 001751 001751 00000000000 13544635323 014177 5ustar00metameta000000 000000 xrdp-0.9.12/instfiles/000755 001751 001751 00000000000 13601646134 014504 5ustar00metameta000000 000000 xrdp-0.9.12/m4/000755 001751 001751 00000000000 13601646122 013021 5ustar00metameta000000 000000 xrdp-0.9.12/tests/000755 001751 001751 00000000000 13544635323 013652 5ustar00metameta000000 000000 xrdp-0.9.12/compile000755 001751 001751 00000016327 13601646125 014073 0ustar00metameta000000 000000 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 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*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]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.9.12/keygen/000755 001751 001751 00000000000 13601646134 013766 5ustar00metameta000000 000000 xrdp-0.9.12/description-pak000644 001751 001751 00000000025 13544635323 015524 0ustar00metameta000000 000000 RDP server for Linux xrdp-0.9.12/install.txt000644 001751 001751 00000002671 13544635323 014725 0ustar00metameta000000 000000 Installation directions for xrdp. Things you need to compile and install. Most systems don't have these installed by default. gcc and make Header files for pam Header files for openssl You can build sesman without pam, there is a Makefile parameter for that. I also have a replacement ssl_calls.c to avoid the openssl dependency email me(Jay) for it or see http://server1.xrdp.org/xrdp/openssl. Due to the license, I can't include it in this project. http://server1.xrdp.org/xrdp/openssl/ unpack the tarball tar -zxvf xrdp-0.1.tar.gz this will create a folder xrdp switch to the xrdp folder(cd xrdp) run make as root, run make install This will install most of the files in /usr/local/xrdp. Some files install in /etc/xrdp. These are configuration files. files and location /usr/local/xrdp/startwm.sh - script that starts the window manager You may need to edit this file to run your window manager. /etc/sesman.ini - sesman configuration file /etc/rsakeys.ini - rsa stuff /etc/xrdp.ini - xrdp configuration file /var/run/sesman.pid /var/rub/xrdp.pid Sesman and xrdp both have to be running as root. You should set them to start when the system starts. You can use xrdp_control.sh script to start them. To completely remove xrdp remove directory /usr/local/xrdp remove directory /etc/xrdp remove file /var/run/xrdp.pid remove file /var/run/sesman.pid remove any startup links added to /etc/init.d or /etc/rcX.d jay.sorg@gmail.com xrdp-0.9.12/faq-compile.txt000644 001751 001751 00000002520 13544635323 015445 0ustar00metameta000000 000000 Compile FAQ Q. I get one of the following errors: - "security/pam_appl.h: File or directory doesn't exist" - "configure: error: please install libpam0g-dev or pam-devel" What is wrong? A. You need to install the pam development package. For Debian / Ubuntu this package is called libpam0g-dev. For Red Hat / SUSE this package is called pam-devel. Q. I get an error: "configure: error: please install libssl-dev or openssl-devel" A. You need to install the openssl development package. For Debian / Ubuntu this package is called libssl-dev. For Red Hat / Fedora this package is called openssl-devel. For SUSE / openSUSE this package is called libopenssl-devel. Q. I get one of the following errors: - "configure: error: please install libx11-dev or libX11-devel" - "configure: error: please install libx11-dev and libxfixes-dev or libXfixes-devel" A. You need to install the X11 and X11 Xfixes development package(s). For Debian: libx11-dev and libxfixes-dev. For Red Hat / SUSE: libX11-devel and libXfixes-devel. Q. I get an error: "rail.c:31:35: fatal error: X11/extensions/Xrandr.h: No such file or directory" A. You need to install the Xrandr development package. For Debian / Ubuntu this package is called libxrandr-dev. For SUSE / openSUSE this package is called libXrandr-devel. xrdp-0.9.12/xrdpapi/000755 001751 001751 00000000000 13601646134 014153 5ustar00metameta000000 000000 xrdp-0.9.12/librfxcodec/000755 001751 001751 00000000000 13601646134 014770 5ustar00metameta000000 000000 xrdp-0.9.12/sesman/000755 001751 001751 00000000000 13601646134 013772 5ustar00metameta000000 000000 xrdp-0.9.12/libpainter/000755 001751 001751 00000000000 13601646134 014635 5ustar00metameta000000 000000 xrdp-0.9.12/faq-general.txt000644 001751 001751 00000000743 13544635323 015437 0ustar00metameta000000 000000 General FAQ Q. What is RDP? A. RDP stands for Remote Desktop Protocol. It's the protocol used by Windows terminal servers to talk to the terminal server clients. Q. What is xrdp? A. xrdp, usually spelled in lower case, is as open source implementation of the RDP protocol. Q. I can't get xrdp to compile in Ubuntu. What can I do? A. See faq-compile.txt. Q. Can I use LDAP? A. Yes, xrdp uses PAM and thus can be configured to use LDAP for authentication. xrdp-0.9.12/configure.ac000644 001751 001751 00000032503 13601645342 014775 0ustar00metameta000000 000000 # Process this file with autoconf to produce a configure script AC_PREREQ(2.65) AC_INIT([xrdp], [0.9.12], [xrdp-devel@googlegroups.com]) 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_C_CONST AC_PROG_LIBTOOL 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])]) AX_CFLAGS_WARN_ALL AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) AX_GCC_FUNC_ATTRIBUTE([format]) AX_TYPE_SOCKLEN_T 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_ARG_WITH([socketdir], [AS_HELP_STRING([--with-socketdir=DIR], [Use directory for UNIX sockets (default: /tmp/.xrdp)])], [], [with_socketdir="/tmp/.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(pam, AS_HELP_STRING([--disable-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 (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)])) AC_ARG_ENABLE(xrdpdebug, AS_HELP_STRING([--enable-xrdpdebug], [Build debug (default: no)]), [], [enable_xrdpdebug=no]) AM_CONDITIONAL(XRDP_DEBUG, [test x$enable_xrdpdebug = xyes]) 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(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]) # 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], [])]) # checking if pam should be autodetected. if test "x$enable_pam" = "xyes" then if test "x$enable_kerberos" != "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 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) if test "x$enable_vsock" = "xyes" then enable_vsock=yes AC_CHECK_HEADERS([linux/socket.h linux/vm_sockets.h], [AC_DEFINE([XRDP_ENABLE_VSOCK], 1, [Enable AF_VSOCK])], [], [#include ]) 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 if test "x$enable_pam" != "xyes" || test "x$bsd" = "xtrue" then AC_DEFINE([USE_NOPAM],1,[Disable PAM]) 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 if test "x$enable_xrdpdebug" = "xyes" then CFLAGS="-g -O0" 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" 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 PKG_INSTALLDIR AC_CHECK_HEADERS([sys/prctl.h]) AC_CONFIG_FILES([ common/Makefile docs/Makefile docs/man/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 libxrdp/Makefile Makefile mc/Makefile neutrinordp/Makefile pkgconfig/Makefile pkgconfig/xrdp.pc pkgconfig/xrdp-uninstalled.pc sesman/chansrv/Makefile sesman/libscp/Makefile sesman/Makefile sesman/tools/Makefile vnc/Makefile xrdpapi/Makefile xrdp/Makefile xrdpvr/Makefile xup/Makefile ]) 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 " pam $enable_pam" echo " kerberos $enable_kerberos" echo " debug $enable_xrdpdebug" echo " rdpsndaudin $enable_rdpsndaudin" echo "" echo " strict_locations $enable_strict_locations" echo " prefix $prefix" echo " exec_prefix $exec_prefix" echo " libdir $libdir" echo " bindir $bindir" echo " sysconfdir $sysconfdir" # 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.9.12/xrdp/000755 001751 001751 00000000000 13601646134 013461 5ustar00metameta000000 000000 xrdp-0.9.12/common/000755 001751 001751 00000000000 13601646133 013773 5ustar00metameta000000 000000 xrdp-0.9.12/vnc/000755 001751 001751 00000000000 13601646133 013271 5ustar00metameta000000 000000 xrdp-0.9.12/depcomp000755 001751 001751 00000056020 13601646126 014065 0ustar00metameta000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 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 . EOF exit $? ;; -v | --v*) echo "depcomp $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 digits=0123456789 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 interferences 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 obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB 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.9.12/missing000755 001751 001751 00000015336 13601646125 014113 0ustar00metameta000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: xrdp-0.9.12/design.txt000644 001751 001751 00000002262 13544635323 014524 0ustar00metameta000000 000000 This document is intended to explain xrdp server design. Many connections, all capable of running different modules one connection could be using a vnc connection one could be running a custom app made for xrdp one could be running a X11 session clients control the screen size and color depth all controlled by a configuration file. you can create a lib or use a lib with your executable that talks to xrdp server. ------ ---------- -xrdp---linked-------mylib.so- session 1 ------ ---------- | | ------------------------- |----unix socket--myapp linked to libxrdp- session 2 | ------------------------- | | ----------- |----linked-------mylib2.so- session 3 ----------- Any of the above sessions can repeat or have different session numbers or not even be used. If a session is disconnected, all that changes is the rdp connection is lost, the session remains. For X11, start the XServer after the user is authenticated. First check for the next available X11 display, create a user session, start the XServer and set the DISPLAY environment variable. xrdp-0.9.12/libxrdp/000755 001751 001751 00000000000 13601646134 014150 5ustar00metameta000000 000000 xrdp-0.9.12/xup/000755 001751 001751 00000000000 13601646133 013317 5ustar00metameta000000 000000 xrdp-0.9.12/config.sub000755 001751 001751 00000105526 13601646125 014500 0ustar00metameta000000 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.9.12/pkgconfig/000755 001751 001751 00000000000 13601646134 014453 5ustar00metameta000000 000000 xrdp-0.9.12/Makefile.in000644 001751 001751 00000066000 13601646125 014553 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = common vnc xup mc neutrinordp libxrdp libpainter \ librfxcodec xrdp sesman keygen docs instfiles genkeymap \ xrdpapi pkgconfig xrdpvr am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config_ac-h.in \ COPYING 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 -200 -exec chmod u+w {} ';' \ && 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 = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 EXTRA_DIST = \ COPYING \ README.md \ NEWS.md \ astyle_config.as \ bootstrap \ coding_style.md \ description-pak \ design.txt \ faq-compile.txt \ faq-general.txt \ file-loc.txt \ fontdump \ install.txt \ m4 \ postinstall-pak \ tcutils \ tests \ 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 SUBDIRS = \ common \ vnc \ xup \ mc \ $(NEUTRINORDPDIR) \ libxrdp \ $(PAINTERDIR) \ $(RFXCODECDIR) \ xrdp \ sesman \ keygen \ docs \ instfiles \ genkeymap \ xrdpapi \ pkgconfig \ $(XRDPVRDIR) 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 @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config_ac.h $(srcdir)/config_ac-h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 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) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @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-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ 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) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-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 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: xrdp-0.9.12/docs/000755 001751 001751 00000000000 13601646134 013434 5ustar00metameta000000 000000 xrdp-0.9.12/vrplayer/000755 001751 001751 00000000000 13544635323 014354 5ustar00metameta000000 000000 xrdp-0.9.12/config_ac-h.in000644 001751 001751 00000004674 13601646125 015204 0ustar00metameta000000 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 the system has the `format' function attribute */ #undef HAVE_FUNC_ATTRIBUTE_FORMAT /* 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 /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Using OpenPAM */ #undef HAVE_PAM_CONSTANTS_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_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_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 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Disable PAM */ #undef USE_NOPAM /* Version number of package */ #undef VERSION /* 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 /* Substitute for socklen_t */ #undef socklen_t xrdp-0.9.12/neutrinordp/000755 001751 001751 00000000000 13601646133 015054 5ustar00metameta000000 000000 xrdp-0.9.12/bootstrap000755 001751 001751 00000001065 13544635323 014455 0ustar00metameta000000 000000 #!/bin/sh which autoconf if ! test $? -eq 0 then echo "error, install autoconf" exit 1 fi which automake if ! test $? -eq 0 then echo "error, install automake" exit 1 fi which libtool || which libtoolize if ! test $? -eq 0 then echo "error, install libtool" exit 1 fi which 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 autoreconf -fvi xrdp-0.9.12/coding_style.md000644 001751 001751 00000006151 13544635323 015520 0ustar00metameta000000 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.9.12/README.md000644 001751 001751 00000011646 13601645342 013773 0ustar00metameta000000 000000 [![Build Status](https://travis-ci.org/neutrinolabs/xrdp.svg?branch=devel)](https://travis-ci.org/neutrinolabs/xrdp) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/neutrinolabs/xrdp) ![Apache-License](https://img.shields.io/badge/License-Apache%202.0-blue.svg) *Current Version:* 0.9.12 # 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, NeutrinoRDP and Microsoft Remote Desktop Client (for Windows, Mac OS, iOS and 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 * 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)) * drive redirection (mount local client drives on remote machine) ## 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. ## Environment **xrdp** primarily targets to GNU/Linux. Tested on x86, x86_64, SPARC and PowerPC. xorgxrdp and RemoteFX Codec have special optimization for x86 and x86_64 using SIMD instructions. FreeBSD is not a primary target of xrdp. It is working on FreeBSD except for the drive redirection feature. Other operating systems such as macOS are not supported so far, but we welcome your contributions. ## 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 **pkgconfig**. ### 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 ├── fontdump ···· font dump for Windows ├── 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 ├── sesman ······ session manager for xrdp ├── tcutils ····· QT based utility program for thin clients ├── tests ······· tests for the code ├── 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 ········· X11rdp and xorgxrdp client module ``` xrdp-0.9.12/config.guess000755 001751 001751 00000126014 13601646125 015030 0ustar00metameta000000 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.9.12/configure000755 001751 001751 00001742563 13601646124 014434 0ustar00metameta000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for xrdp 0.9.12. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 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 -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_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 exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && 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 as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else 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 test -z "$as_dir" && as_dir=. 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_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS 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'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$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 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=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" 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.9.12' PACKAGE_STRING='xrdp 0.9.12' PACKAGE_BUGREPORT='xrdp-devel@googlegroups.com' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" enable_option_checking=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS pkgconfigdir moduledir X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF TurboJpegLibDir TurboJpegIncDir PIXMAN_LIBS PIXMAN_CFLAGS FDKAAC_LIBS FDKAAC_CFLAGS FUSE_LIBS FUSE_CFLAGS FREERDP_LIBS FREERDP_CFLAGS PAM_RULES 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_NEUTRINORDP_FALSE XRDP_NEUTRINORDP_TRUE XRDP_DEBUG_FALSE XRDP_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 CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP 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_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V 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 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_pam enable_vsock enable_ipv6 enable_ipv6only enable_kerberos enable_bsd enable_pamuserpass enable_pam_config enable_xrdpdebug enable_neutrinordp enable_jpeg enable_tjpeg enable_fuse enable_xrdpvr enable_fdkaac enable_opus enable_mp3lame enable_pixman enable_painter enable_rfxcodec enable_rdpsndaudin with_x enable_strict_locations with_pkgconfigdir ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR OPENSSL_CFLAGS OPENSSL_LIBS FREERDP_CFLAGS FREERDP_LIBS FUSE_CFLAGS FUSE_LIBS FDKAAC_CFLAGS FDKAAC_LIBS PIXMAN_CFLAGS PIXMAN_LIBS XMKMF' 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' 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 # Accept the important Cygnus configure options, so we can diagnose typos. 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=`$as_echo "$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=`$as_echo "$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 ;; -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=`$as_echo "$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=`$as_echo "$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. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` 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" ;; *) $as_echo "$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 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 || $as_echo 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.9.12 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] --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.9.12:";; 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) --disable-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 (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-xrdpdebug Build debug (default: no) --enable-neutrinordp Build neutrinordp module (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-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 (default: /tmp/.xrdp) --with-systemdsystemunitdir=DIR Directory for systemd service files, no to disable --with-x use the X Window System --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. CPP 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 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 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$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.9.12 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF 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 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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_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$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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # 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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status 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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #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 (); /* 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 () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------ ## ## Report this to xrdp-devel@googlegroups.com ## ## ------------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel 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.9.12, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _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 test -z "$as_dir" && as_dir=. $as_echo "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=`$as_echo "$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=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$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 $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$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=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`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.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. 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=`$as_echo "$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 case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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 (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." 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.9.12' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # 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 -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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. $as_echo "$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\"" $as_echo "$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 $as_echo "$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 () { ; 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$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+set}" = set && 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 ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$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 () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -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 **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF 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 test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "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.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' 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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". 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 thusly: # 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #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}; /* AIX 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; } { /* AIX 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 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "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*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$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+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else 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 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else 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* | 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 fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #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 fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$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}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else 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='/usr/bin/file -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*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-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=/usr/bin/file 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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=$? $as_echo "$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=$? $as_echo "$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.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # 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++, # 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=$? $as_echo "$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=$? $as_echo "$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=$? $as_echo "$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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no 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|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else 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" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$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+set}" = set; 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else 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 cru libconftest.a conftest.o" >&5 $AR cru 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$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*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test 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_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "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 ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue 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 # Passes both tests. ac_preproc_ok=: break 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 fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue 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 # Passes both tests. ac_preproc_ok=: break 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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : 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 : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; 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 enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; 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 enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; 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 pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; 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 enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; 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 if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF 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, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$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\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "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++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) 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 ;; 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 == "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 ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi 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 ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi 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++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC 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 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*) 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) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else 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 lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$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 ;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $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=$? $as_echo "$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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "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*) # Native MSVC 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 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*) # 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 ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; 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$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$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 lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$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 fi fi fi fi 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else 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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$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\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else 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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$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: if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi 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 # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5 $as_echo_n "checking CFLAGS for maximum warnings... " >&6; } if ${ac_cv_cflags_warn_all+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; 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.$ac_ext done CFLAGS="$ac_save_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 $as_echo "$ac_cv_cflags_warn_all" >&6; } case ".$ac_cv_cflags_warn_all" in .ok|.ok,*) ;; .|.no|.no,*) ;; *) if ${CFLAGS+:} false; then : case " $CFLAGS " in #( *" $ac_cv_cflags_warn_all "*) : { { $as_echo "$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $ac_cv_cflags_warn_all" { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else CFLAGS=$ac_cv_cflags_warn_all { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 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=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in #( *" $flag "*) : { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $flag" { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else CFLAGS=$flag { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi else : fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__((format))" >&5 $as_echo_n "checking for __attribute__((format))... " >&6; } if ${ax_cv_have_func_attribute_format+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo(const char *p, ...) __attribute__((format(printf, 1, 2))); int main () { ; 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 ax_cv_have_func_attribute_format=yes fi else ax_cv_have_func_attribute_format=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_func_attribute_format" >&5 $as_echo "$ax_cv_have_func_attribute_format" >&6; } if test yes = $ax_cv_have_func_attribute_format; then : cat >>confdefs.h <<_ACEOF #define HAVE_FUNC_ATTRIBUTE_FORMAT 1 _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 $as_echo_n "checking for socklen_t... " >&6; } if ${ac_cv_ax_type_socklen_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { 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 ac_cv_ax_type_socklen_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ax_type_socklen_t" >&5 $as_echo "$ac_cv_ax_type_socklen_t" >&6; } if test $ac_cv_ax_type_socklen_t != yes; then $as_echo "#define socklen_t int" >>confdefs.h fi 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 # Check whether --with-socketdir was given. if test "${with_socketdir+set}" = set; then : withval=$with_socketdir; else with_socketdir="/tmp/.xrdp" fi socketdir=$with_socketdir # Check whether --with-systemdsystemunitdir was given. if test "${with_systemdsystemunitdir+set}" = set; then : withval=$with_systemdsystemunitdir; else if test "x$linux" = xyes; then with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) fi 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-pam was given. if test "${enable_pam+set}" = set; then : enableval=$enable_pam; else enable_pam=yes 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+set}" = set; then : enableval=$enable_vsock; else enable_vsock=no fi # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then : enableval=$enable_ipv6; else enable_ipv6=no fi # Check whether --enable-ipv6only was given. if test "${enable_ipv6only+set}" = set; then : enableval=$enable_ipv6only; else enable_ipv6only=no fi # Check whether --enable-kerberos was given. if test "${enable_kerberos+set}" = set; then : enableval=$enable_kerberos; else enable_kerberos=no fi # Check whether --enable-bsd was given. if test "${enable_bsd+set}" = set; then : enableval=$enable_bsd; bsd=true else bsd=false 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+set}" = set; then : enableval=$enable_pamuserpass; else enable_pamuserpass=no 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+set}" = set; then : enableval=$enable_pam_config; fi # Check whether --enable-xrdpdebug was given. if test "${enable_xrdpdebug+set}" = set; then : enableval=$enable_xrdpdebug; else enable_xrdpdebug=no fi if test x$enable_xrdpdebug = xyes; then XRDP_DEBUG_TRUE= XRDP_DEBUG_FALSE='#' else XRDP_DEBUG_TRUE='#' XRDP_DEBUG_FALSE= fi # Check whether --enable-neutrinordp was given. if test "${enable_neutrinordp+set}" = set; then : enableval=$enable_neutrinordp; else enable_neutrinordp=no 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-jpeg was given. if test "${enable_jpeg+set}" = set; then : enableval=$enable_jpeg; else enable_jpeg=no 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+set}" = set; then : enableval=$enable_tjpeg; else enable_tjpeg=no 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+set}" = set; then : enableval=$enable_fuse; else enable_fuse=no 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+set}" = set; then : enableval=$enable_xrdpvr; else enable_xrdpvr=no 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+set}" = set; then : enableval=$enable_fdkaac; else enable_fdkaac=no 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+set}" = set; then : enableval=$enable_opus; else enable_opus=no 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+set}" = set; then : enableval=$enable_mp3lame; else enable_mp3lame=no 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+set}" = set; then : enableval=$enable_pixman; else enable_pixman=no 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+set}" = set; then : enableval=$enable_painter; else enable_painter=yes 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+set}" = set; then : enableval=$enable_rfxcodec; else enable_rfxcodec=yes 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+set}" = set; then : enableval=$enable_rdpsndaudin; else enable_rdpsndaudin=no fi if test x$enable_rdpsndaudin = xyes; then XRDP_RDPSNDAUDIN_TRUE= XRDP_RDPSNDAUDIN_FALSE='#' else XRDP_RDPSNDAUDIN_TRUE='#' XRDP_RDPSNDAUDIN_FALSE= fi # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : DLOPEN_LIBS=-ldl fi fi # checking for openssl pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OPENSSL" >&5 $as_echo_n "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" && \ { { $as_echo "$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=$? $as_echo "$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" && \ { { $as_echo "$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=$? $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_OPENSSL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_OPENSSL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi OPENSSL=$ac_cv_path_OPENSSL if test -n "$OPENSSL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENSSL" >&5 $as_echo "$OPENSSL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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_mongrel "$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 : $as_echo "#define HAVE__PAM_TYPES_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$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 : $as_echo "#define HAVE_PAM_CONSTANTS_H 1" >>confdefs.h fi # checking if pam should be autodetected. if test "x$enable_pam" = "xyes" then if test "x$enable_kerberos" != "xyes" then if test -z "$enable_bsd" then ac_fn_c_check_header_mongrel "$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 as_fn_error $? "please install libpam0g-dev or pam-devel" "$LINENO" 5 fi 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 if test "x$enable_vsock" = "xyes" then enable_vsock=yes for ac_header in linux/socket.h linux/vm_sockets.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_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 `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF $as_echo "#define XRDP_ENABLE_VSOCK 1" >>confdefs.h fi done fi if test "x$enable_ipv6only" = "xyes" then enable_ipv6=yes $as_echo "#define XRDP_ENABLE_IPV6ONLY 1" >>confdefs.h fi if test "x$enable_ipv6" = "xyes" then $as_echo "#define XRDP_ENABLE_IPV6 1" >>confdefs.h fi if test "x$enable_pam" != "xyes" || test "x$bsd" = "xtrue" then $as_echo "#define USE_NOPAM 1" >>confdefs.h fi if test "x$enable_neutrinordp" = "xyes" ; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREERDP" >&5 $as_echo_n "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" && \ { { $as_echo "$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=$? $as_echo "$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" && \ { { $as_echo "$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=$? $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # checking for libjpeg if test "x$enable_jpeg" = "xyes" then ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" if test "x$ac_cv_header_jpeglib_h" = xyes; then : else as_fn_error $? "please install libjpeg-dev or libjpeg-devel" "$LINENO" 5 fi fi if test "x$enable_xrdpdebug" = "xyes" then CFLAGS="-g -O0" fi # checking for fuse if test "x$enable_fuse" = "xyes" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FUSE" >&5 $as_echo_n "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" && \ { { $as_echo "$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=$? $as_echo "$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" && \ { { $as_echo "$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=$? $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # checking for fdk aac if test "x$enable_fdkaac" = "xyes" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FDKAAC" >&5 $as_echo_n "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" && \ { { $as_echo "$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=$? $as_echo "$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" && \ { { $as_echo "$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=$? $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # checking for opus if test "x$enable_opus" = "xyes" then ac_fn_c_check_header_mongrel "$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 as_fn_error $? "please install libopus-dev or opus-devel" "$LINENO" 5 fi fi # checking for lame mp3 if test "x$enable_mp3lame" = "xyes" then ac_fn_c_check_header_mongrel "$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 as_fn_error $? "please install libmp3lame-dev or lamemp3-devel" "$LINENO" 5 fi fi if test "x$enable_pixman" = "xyes" ; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PIXMAN" >&5 $as_echo_n "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" && \ { { $as_echo "$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=$? $as_echo "$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" && \ { { $as_echo "$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=$? $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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=`$as_echo "ac_cv_header_$TURBOJPEG_PATH/include/turbojpeg.h" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$TURBOJPEG_PATH/include/turbojpeg.h" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : else as_fn_error $? "could not find TurboJPEG in dir specified by env variable TURBOJPEG_PATH ($TURBOJPEG_PATH)" "$LINENO" 5 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_mongrel "$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 as_fn_error $? "please install TurboJPEG " "$LINENO" 5 fi TurboJpegIncDir="" TurboJpegLibDir="" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; 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 ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no 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 /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 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 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 () { 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 LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$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 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no 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 fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$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'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "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. $as_echo "#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 . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "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 () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ 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. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$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 fi rm -f core conftest.err conftest.$ac_objext \ 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$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 as_fn_error $? "please install libxfixes-dev or libXfixes-devel" "$LINENO" 5 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 as_fn_error $? "please install libxrandr-dev or libXrandr-devel" "$LINENO" 5 fi CFLAGS="$save_CFLAGS" moduledir='${libdir}/xrdp' # Check whether --enable-strict-locations was given. if test "${enable_strict_locations+set}" = set; then : enableval=$enable_strict_locations; else enable_strict_locations=no fi if test "x$enable_strict_locations" != "xyes"; then sysconfdir="/etc"; localstatedir="/var"; fi # Check whether --with-pkgconfigdir was given. if test "${with_pkgconfigdir+set}" = set; then : withval=$with_pkgconfigdir; else with_pkgconfigdir='${libdir}/pkgconfig' fi pkgconfigdir=$with_pkgconfigdir for ac_header in sys/prctl.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/prctl.h" "ac_cv_header_sys_prctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_prctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_PRCTL_H 1 _ACEOF fi done ac_config_files="$ac_config_files common/Makefile docs/Makefile docs/man/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 libxrdp/Makefile Makefile mc/Makefile neutrinordp/Makefile pkgconfig/Makefile pkgconfig/xrdp.pc pkgconfig/xrdp-uninstalled.pc sesman/chansrv/Makefile sesman/libscp/Makefile sesman/Makefile sesman/tools/Makefile vnc/Makefile xrdpapi/Makefile xrdp/Makefile xrdpvr/Makefile xup/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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$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+set}" = set || &/ 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 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$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=`$as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' 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 "${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 "${XRDP_DEBUG_TRUE}" && test -z "${XRDP_DEBUG_FALSE}"; then as_fn_error $? "conditional \"XRDP_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_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 : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$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 -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _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.9.12, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _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 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ xrdp config.status 0.9.12 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$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 ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$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 ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _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 \$as_echo "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 $as_echo "$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"`' 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"`' 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 \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ 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" ;; "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" ;; "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" ;; "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" ;; "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/chansrv/Makefile") CONFIG_FILES="$CONFIG_FILES sesman/chansrv/Makefile" ;; "sesman/libscp/Makefile") CONFIG_FILES="$CONFIG_FILES sesman/libscp/Makefile" ;; "sesman/Makefile") CONFIG_FILES="$CONFIG_FILES sesman/Makefile" ;; "sesman/tools/Makefile") CONFIG_FILES="$CONFIG_FILES sesman/tools/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" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason 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=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _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@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _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"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && 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 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$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 $as_echo "/* $configure_input */" \ && 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 || $as_echo 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) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # 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=`$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" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo 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 || $as_echo 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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. 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 # 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. AR_FLAGS=$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 # # 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=`$as_echo "$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=`$as_echo "$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)" $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 $as_echo "$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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" # Check for guested configure; otherwise get Cygnus style configure. 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 elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$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 " pam $enable_pam" echo " kerberos $enable_kerberos" echo " debug $enable_xrdpdebug" echo " rdpsndaudin $enable_rdpsndaudin" echo "" echo " strict_locations $enable_strict_locations" echo " prefix $prefix" echo " exec_prefix $exec_prefix" echo " libdir $libdir" echo " bindir $bindir" echo " sysconfdir $sysconfdir" # 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.9.12/install-sh000755 001751 001751 00000036010 13601646125 014510 0ustar00metameta000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # 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 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 the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? 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 '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac 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 && $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 # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook '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.9.12/astyle_config.as000644 001751 001751 00000002444 13544635323 015667 0ustar00metameta000000 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-preprocessor --indent-col1-comments --min-conditional-indent=2 --max-instatement-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-brackets --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 # 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.9.12/Makefile.am000644 001751 001751 00000001676 13544635323 014556 0ustar00metameta000000 000000 ACLOCAL_AMFLAGS = -I m4 AM_DISTCHECK_CONFIGURE_FLAGS = \ --without-systemdsystemunitdir \ --enable-strict-locations EXTRA_DIST = \ COPYING \ README.md \ NEWS.md \ astyle_config.as \ bootstrap \ coding_style.md \ description-pak \ design.txt \ faq-compile.txt \ faq-general.txt \ file-loc.txt \ fontdump \ install.txt \ m4 \ postinstall-pak \ tcutils \ tests \ 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 SUBDIRS = \ common \ vnc \ xup \ mc \ $(NEUTRINORDPDIR) \ libxrdp \ $(PAINTERDIR) \ $(RFXCODECDIR) \ xrdp \ sesman \ keygen \ docs \ instfiles \ genkeymap \ xrdpapi \ pkgconfig \ $(XRDPVRDIR) distclean-local: -rm -f xrdp_configure_options.h xrdp-0.9.12/aclocal.m4000644 001751 001751 00000122543 13601646124 014352 0ustar00metameta000000 000000 # generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 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.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 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-2018 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-2018 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 thusly: # 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-2018 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. 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-2018 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 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_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # 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 ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 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-2018 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-2018 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-2018 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 case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac 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-2018 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-2018 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) 2001-2018 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-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 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-2018 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-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/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.9.12/fontdump/000755 001751 001751 00000000000 13544635323 014344 5ustar00metameta000000 000000 xrdp-0.9.12/genkeymap/000755 001751 001751 00000000000 13601646134 014464 5ustar00metameta000000 000000 xrdp-0.9.12/xrdpvr/000755 001751 001751 00000000000 13601646134 014031 5ustar00metameta000000 000000 xrdp-0.9.12/NEWS.md000644 001751 001751 00000033300 13601645342 013601 0ustar00metameta000000 000000 # Release notes for xrdp v0.9.12 (2019/12/28) ## Bug fixes * Fix "The log reference is NULL" error when sesman startup #1425 * Fix behavior when shmem_id changes #1439 * Make vsock config accept -1 for cid and port #1441 * Cleanup refresh rect and check stream bounds #1437 * Significant improvements in drive redirection #1449 * Fix build on macOS Catalina #1462 ## Other changes * Proprietary microphone redirection via rdpsnd is now default off RDP compatible microphone redirection is on instead #1427 * Skip connecting to chansrv when no channels enabled #1393 * Add openSUSE's pam rules #1442 * Do not terminate xrdp daemon when caught SIGHUP #1319 ## Known issues * FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266 * Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965 # Release notes for xrdp v0.9.11 (2019/08/19) ## New features * Suppress output (do not draw screen when client window is minimized) #1330 * Audio input (microphone) redirection compatible with [MS-RDPEAI](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpeai/d04ffa42-5a0f-4f80-abb1-cc26f71c9452) #1369 * Now xrdp can listen on more than one port #1124 #1366 ## Bug fixes * Fix the issue audio redirection sometimes sounds with long delay #1363 * Check term event for more responsive shutdown #1372 ## Known issues * FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266 * Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965 ----------------------- # Release notes for xrdp v0.9.11 (2019/08/19) ## New features * Suppress output (do not draw screen when client window is minimized) #1330 * Audio input (microphone) redirection compatible with [MS-RDPEAI](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpeai/d04ffa42-5a0f-4f80-abb1-cc26f71c9452) #1369 * Now xrdp can listen on more than one port #1124 #1366 ## Bug fixes * Fix the issue audio redirection sometimes sounds with long delay #1363 * Check term event for more responsive shutdown #1372 ## Known issues * FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266 * Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965 ----------------------- # Release notes for xrdp v0.9.10 (2019/04/18) ## Special thanks Thank you for matt335672 contributing to lots of improvements in drive redirection! ## New features * Restrict outbound (server->client) clipboard transfer, configured in `sesman.ini` #1298 ## Bug fixes * Fix the issue libscp v1 not setting width but height twice #1293 * Fix the issue reconnecting to session causes duplicate drive entries in fuse fs #1299 * Fix default_wm and reconnect_sh refer wrong path after sesman caught SIGUP #1315 #1331 * Shutdown xrdp more responsively #1325 * Improve remote file lookup in drive redirection #996 #1327 * Overwriting & appending to existing files is are now supported #1327 ## Other changes * Add Danish Keyboard #1290 * Put xrdp- prefix to some executables appear in man page #1313 * Replace some URLs from SF.net to xrdp.org #1313 ## Known issues * FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266 * Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965 ----------------------- ## Release notes for xrdp v0.9.9 (2018/12/25) ## Release cycle From the next release, release cycle will be changed from quarterly to every 4 months. xrdp will be released in April, August, December. ## New features * Disconnection by idle timeout (requires xorgxrdp v0.2.9 or later) #1227 * Glyph cache v2 (fixes no font issue on iOS/macOS/Android client) #367 #1235 ## Bug fixes * Fix xrdp-chansrv crashes caused in drive redirection #1202 #1225 * Fix build with FDK AAC v2 #1257 * Do not enable RemoteApp if the INFO_RAIL flag is not set (RDP-RDP proxy) #1253 ## Other changes * Add Spanish Latin Amarican keyboard #1237 #1240 #1244 * Dynamic channel improvements #1222 #1224 * Remove some deprecated sesman session types #1232 * Refactoring and cleanups ## Known issues * FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266 * Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965 ----------------------- # Release notes for xrdp v0.9.8 (2018/09/25) ## Deprecation notice We removed TLSv1 and TLSv1.1 from the default config. The current default is TLSv1.2 and TLSv1.3. Users can whenever re-enable these early TLS versions by editing xrdp. To use TLSv1.3, OpenSSL or LibreSSL must support TLSv1.3. You can know the OpenSSL or LibreSSL version by `xrdp --version` command that compiled with xrdp. ## Other topics Pulseaudio modules has been removed from xrdp source tree since it is actually independent and not part of xrdp. The repository has been moved to: https://github.com/neutrinolabs/pulseaudio-module-xrdp If you want to use audio redirection, make sure install the module separately. ## New features * Add TLSv1.3 support #1193 ## Bug fixes * Ensure unmount redirected drive on fatal X error #1140 ## Other changes * Show more helpful message if xrdp-dis failed #1206 * Pass pulse socket name via environment variable #1198 * Fix xrdp's log path in man page #1168 # Release notes for xrdp v0.9.7 (2018/06/29) ## Deprecation notice x11rdp has been removed from xrdp reposiory and stored in the separate repository. Checkout [x11rdp repository](https://github.com/neutrionlabs/x11rdp) if you still need x11rdp. In most cases, [xorgxrdp](https://github.com/neutrinolabs/xorgxrdp) can replace x11rdp. ## Bug fixes * Fix endianness detection on ppc64el #1082 * Fix a bug xrdp file copy slow #1112 #1132 * Copy the PAM session environment for the reconnect script #1120 * Accept fullpath for DefaultWindowManager, ReconnectScript #1147 ## Other changes * Add PAM support for Arch Linux #1078 * Show OpenSSL version to '--version' CLI option #1096 * Separate x11rdp from xrdp repository #1104 * Support sesrun start xorgxrdp sessions #1108 * Show configure summary when configure is done #1126 #1134 #1137 * Less spit on the console when sesman starts #1142 * Fix memory leaks #1146 * Separate rc script for FreeBSD into xrdp and xrdp-sesman #1153 * Improve documents and helps ## Known issues * Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965 ----------------------- # Release notes for xrdp v0.9.6 (2018/03/26) ## Compatibility notice Exclamation mark (`!`) has been removed from comment out symbol of config files. Use number sign (`#`) or semicolon (`;`) instead. As a result of this change, now you can use exclamation mark as config value such as in `tls_ciphers`. ``` tls_ciphers=HIGH:!aNULL:!eNULL:!EXPORT:!RC4 ``` See also: #1033 ## macOS supports Please note that xrdp still doesn't support macOS officially so far. However, a volunteer is working on macOS compatibility. * Generate dylibs for macOS #1015 * Add PAM support for macOS #1021 ## Bug fixes * Make listen check before daemon fork #988 * Fix xrdp sometimes become zombie processes #1000 * Include hostname in sesman password file name #1006 #1007 #1076 * Fix default startwm.sh to use bash explicitly #1009 #1049 * Fix the issue FreeBSD doesn't acknowledge terminated sessions #1016 #1030 ## Other changes * Add Swiss French keyboard #1053 * Improve perfect forward secrecy, explicitly enable ECDHE/DHE #1024 #1052 #1063 * Lots of leak fixes, cleanups and refactoring ## Known issues * Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965 ----------------------- # Release notes for xrdp v0.9.5 (2017/12/27) ## Security fixes * Fix local denial of service [CVE-2017-16927](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16927) #958 #979 ## New features * Add a new log level TRACE more verbose than DEBUG #835 #944 * SSH agent forwarding via RDP #867 #868 FreeRDP/FreeRDP#4122 * Support horizontal wheel properly #928 ## Bug fixes * Avoid use of hard-coded sesman port #895 * Workaround for corrupted display with Windows Server 2008 using NeutrinoRDP #869 * Fix glitch in audio redirection by AAC #910 #936 * Implement vsock support #930 #935 #948 * Avoid 100% CPU usage on SSL accept #956 ## Other changes * Add US Dvorak keyboard #929 * Suppress some misleading logs #964 * Add Finnish keyboard #972 * Add more user-friendlier description about Xorg config #974 * Renew pulseaudio document #984 #985 * Lots of cleanups and refactoring ## Known issues * Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965 ----------------------- # Release notes for xrdp v0.9.4 (2017/09/28) ## New features * Accept prefill credentials in base64 form #153 #811 * Indroduce AAC encoder to audio redirection (requires Windows 10 client) ## Bugfixes * Fix ocasional SEGV in drive redirection #838 * Fix client's IP addresses in xrdp-sesman.log are always logged as `0.0.0.0` #878 #882 * Fix `ls_background_image` didn't accept full path #776 #853 * Fix misuse of hidelogwindow #414 #876 * Fix WTSVirtualChannelWrite return code #859 * Fix no longer needed socket files remained in the socket dir #812 #831 * Make creating socket path a bit more robust #823 ## Other changes * Add Belgian keyboard #858 * Add a PAM file for FreeBSD #824 * Several refactorings and cosmetic changes ## Known issues * Windows 10 (1703) shows black blank screen in RemoteFX mode * This issue is already fixed at Insider Preview build 16273 ----------------------- # Release notes for xrdp v0.9.3.1 (2017/08/16) This release fixes a trivial packaging issue #848 occurred in v0.9.3. The issue only affects systemd systems. This release is principally for distro packagers or users who compile & install xrdp from source. Users who running xrdp on these systems don't need to upgrade from v0.9.3 to v0.9.3.1. * Linux systems without systemd * non-Linux systems such as BSD operating systems ----------------------- # Release notes for xrdp v0.9.3 (2017/07/15) ## New features * Log user-friendly messages when certificate/privkey is inaccessible ## Bugfixes * Now sesman sets mandatory LOGNAME environment variable #725 * Now sesman ensures socket directory present #801 * Exit with failure status if port already in use #644 * Eliminate some hard coded paths * Fix glitches with IPv4 struct initialization #803 * Fix some keyboard layout integration (UK, Spanish) * Fix handle OS when IPv6 disabled #714 * Fix issues around systemd session #778 * Fix protocol error when 32 bit color and non RemoteFX session #737 #804 * Fix sesadmin shows error when no sessions #797 * Fix TLS spins 100% CPU #728 * Fix Xvnc backend disconnects when some data copied to clipboard #755 * Pick up the first section if given section(domain) doesn't match anything #750 ## Other changes * Change xrdp-chansrv log path to include display number * Optimize startwm.sh for SUSE * Several cleanups and optimizations ## Known issues * Windows 10 (1703) shows black blank screen in RemoteFX mode ----------------------- # Release notes for xrdp v0.9.2 (2017/03/30) ## New features * RemoteFX codec support is now enabled by default. * Bitmap updates support is now enabled by default. * TLS ciphers suites and version is now logged. * Connected computer name is now logged. * Switched to Xorg (xorgxrdp) as the default backend now. * Miscellaneous RemoteFX codec mode improvements. * Socket directory is configurable at the compile time. ## Bugfixes * Parallels client for MacOS / iOS can now connect (audio redirection must be disabled on client or xrdp server though). * MS RDP client for iOS can now connect using TLS security layer. * MS RDP client for Android can now connect to xrdp. * Large resolutions (4K) can be used with RemoteFX graphics. * Multiple RemoteApps can be opened throguh NeutrinoRDP proxy. * tls_ciphers in xrdp.ini is not limited to 63 chars anymore, it's variable-length. * Fixed an issue where tls_ciphers were ignored and rdp security layer could be used instead. * Kill disconnected sessions feature is working with Xorg (xorgxrdp) backend. * Miscellaneous code cleanup and memory issues fixes. ----------------------- # Release notes for xrdp v0.9.1 (2016/12/21) ## New features * New xorgxrdp backend using existing Xorg with additional modules * Improvements to X11rdp backend * Support for IPv6 (disabled by default) * Initial support for RemoteFX Codec (disabled by default) * Support for TLS security layer (preferred over RDP layer if supported by the client) * Support for disabling deprecated SSLv3 protocol and for selecting custom cipher suites in xrdp.ini * Support for bidirectional fastpath (enabled in both directions by default) * Support clients that don't support drawing orders, such as MS RDP client for Android, ChromeRDP (disabled by default) * More configurable login screen * Support for new virtual channels: * rdpdr: device redirection * rdpsnd: audio output * cliprdr: clipboard * xrdpvr: xrdp video redirection channel (can be used along with NeutrinoRDP client) * Support for disabling virtual channels globally or by session type * Allow to specify the path for backends (Xorg, X11rdp, Xvnc) * Added files for systemd support * Multi-monitor support * xrdp-chansrv stroes logs in `${XDG_DATA_HOME}/xrdp` now ## Security fixes * User's password could be recovered from the Xvnc password file * X11 authentication was not used xrdp-0.9.12/xrdpvr/xrdpvr.h000644 001751 001751 00000005156 13544635324 015543 0ustar00metameta000000 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.9.12/xrdpvr/Makefile.in000644 001751 001751 00000051604 13601646126 016105 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/xrdpvr/xrdpvr_internal.h000644 001751 001751 00000020320 13544635324 017425 0ustar00metameta000000 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.9.12/xrdpvr/Makefile.am000644 001751 001751 00000000156 13544635324 016074 0ustar00metameta000000 000000 module_LTLIBRARIES = \ libxrdpvr.la libxrdpvr_la_SOURCES = \ xrdpvr.c \ xrdpvr.h \ xrdpvr_internal.h xrdp-0.9.12/xrdpvr/xrdpvr.c000644 001751 001751 00000066040 13544635324 015535 0ustar00metameta000000 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; if ((rv == 0) && (bytes_to_send == 0)) { return 0; } 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.9.12/genkeymap/evdev-map.c000644 001751 001751 00000006446 13544635323 016532 0ustar00metameta000000 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 */ 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.9.12/genkeymap/dump-keymaps.sh000755 001751 001751 00000002374 13544635323 017451 0ustar00metameta000000 000000 #!/bin/sh which setxkbmap if test $? -ne 0 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 - 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.9.12/genkeymap/Makefile.am000644 001751 001751 00000000406 13544635323 016524 0ustar00metameta000000 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.9.12/genkeymap/genkeymap.c000644 001751 001751 00000010165 13544635323 016617 0ustar00metameta000000 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]; 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.9.12/genkeymap/Makefile.in000644 001751 001751 00000051640 13601646125 016537 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/genkeymap/readme.txt000644 001751 001751 00000002202 13544635323 016462 0ustar00metameta000000 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.9.12/fontdump/fontdump.c000644 001751 001751 00000035023 13544635323 016347 0ustar00metameta000000 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; FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&lpMsgBuf, 0, NULL); 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(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; HDC dc; int height; 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.9.12/fontdump/Makefile000644 001751 001751 00000000472 13544635323 016007 0ustar00metameta000000 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.9.12/fontdump/.gitignore000644 001751 001751 00000000012 13544635323 016325 0ustar00metameta000000 000000 !Makefile xrdp-0.9.12/neutrinordp/xrdp-color.h000644 001751 001751 00000001614 13544635323 017325 0ustar00metameta000000 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.9.12/neutrinordp/xrdp-neutrinordp.h000644 001751 001751 00000021713 13544635323 020562 0ustar00metameta000000 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 other h files */ #include "arch.h" #include "parse.h" #include "os_calls.h" #include "defines.h" #include "xrdp_rail.h" #include "xrdp_client_info.h" /* this is the freerdp main header */ #include #include #include #include //#include //#include "/home/jay/git/jsorg71/staging/include/freerdp/freerdp.h" 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 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); tintptr mod_dumby[100 - 11]; /* 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, char *msg, int code); int (*server_is_term)(struct mod *v); 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 (*server_reset)(struct mod *v, int width, int height, int bpp); 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); /* 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 - 44]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as long */ tintptr wm; tintptr painter; tintptr 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[256]; char password[256]; char domain[256]; 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]; }; xrdp-0.9.12/neutrinordp/xrdp-neutrinordp.c000644 001751 001751 00000210466 13544635323 020562 0ustar00metameta000000 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. */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp-neutrinordp.h" #include "xrdp-color.h" #include "xrdp_rail.h" #include "log.h" #include #if defined(VERSION_STRUCT_RDP_FREERDP) #if VERSION_STRUCT_RDP_FREERDP > 1 #define NEUTRINORDP_HAS_SUPPRESS_OUTPUT #endif #endif #ifdef XRDP_DEBUG #define LOG_LEVEL 99 #else #define LOG_LEVEL 1 #endif #define LLOG(_level, _args) \ do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0) #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { g_writeln _args ; } } while (0) 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 ; } } LLOGLN(0, ("The colormap is all NULL")); } /*****************************************************************************/ /* return error */ static int lxrdp_start(struct mod *mod, int w, int h, int bpp) { rdpSettings *settings; LLOGLN(10, ("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 int lxrdp_connect(struct mod *mod) { boolean ok; LLOGLN(10, ("lxrdp_connect:")); ok = freerdp_connect(mod->inst); LLOGLN(0, ("lxrdp_connect: freerdp_connect returned %d", ok)); if (!ok) { LLOGLN(0, ("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, "Insufficent privileges on target server"); break; default: g_snprintf(buf, 128, "Unhandled Errorcode from connect : %d", connectErrorCode); break; } } log_message(LOG_LEVEL_INFO, buf); mod->server_msg(mod, buf, 0); } #endif log_message(LOG_LEVEL_INFO, "freerdp_connect Failed to " "destination :%s:%d", mod->inst->settings->hostname, mod->inst->settings->port); return 1; } else { log_message(LOG_LEVEL_INFO, "freerdp_connect returned Success to " "destination :%s:%d", mod->inst->settings->hostname, mod->inst->settings->port); } 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; LLOGLN(12, ("lxrdp_event: msg %d", msg)); switch (msg) { case 15: /* key down */ /* 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) { LLOGLN(11, ("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 16: /* key up */ mod->inst->input->KeyboardEvent(mod->inst->input, param4, param3); break; case 17: /* Synchronize */ LLOGLN(11, ("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 100: /* mouse move */ LLOGLN(12, ("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 101: /* left button up */ LLOGLN(12, ("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 102: /* left button down */ LLOGLN(12, ("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 103: /* right button up */ LLOGLN(12, ("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 104: /* right button down */ LLOGLN(12, ("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 105: /* middle button up */ LLOGLN(12, ("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 106: /* middle button down */ LLOGLN(12, ("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 107: /* wheel up */ flags = PTR_FLAGS_WHEEL | 0x0078; mod->inst->input->MouseEvent(mod->inst->input, flags, 0, 0); break; case 108: break; case 109: /* wheel down */ flags = PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x0088; mod->inst->input->MouseEvent(mod->inst->input, flags, 0, 0); break; case 110: break; case 200: LLOGLN(10, ("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 0x5555: chanid = LOWORD(param1); flags = HIWORD(param1); size = (int)param2; data = (char *)param3; total_size = (int)param4; LLOGLN(12, ("lxrdp_event: client to server ,chanid= %d flags= %d", chanid, flags)); if ((chanid < 0) || (chanid >= mod->inst->settings->num_channels)) { LLOGLN(0, ("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: LLOGLN(0, ("Unhandled message type in eventhandler %d", msg)); break; } return 0; } /******************************************************************************/ /* return error */ static int lxrdp_signal(struct mod *mod) { LLOGLN(10, ("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); } } LLOGLN(10, ("lxrdp_end:")); return 0; } /******************************************************************************/ /* return error */ static int lxrdp_set_param(struct mod *mod, const char *name, const char *value) { rdpSettings *settings; LLOGLN(10, ("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) { } 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*/ LLOGLN(10, ("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 { LLOGLN(0, ("lxrdp_set_param: unknown name [%s] value [%s]", name, value)); } return 0; } /******************************************************************************/ static int lxrdp_session_change(struct mod *mod, int a, int b) { LLOGLN(0, ("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; LLOGLN(12, ("lxrdp_get_wait_objs:")); rfds = (void **)read_objs; wfds = (void **)write_objs; ok = freerdp_get_fds(mod->inst, rfds, rcount, wfds, wcount); if (!ok) { LLOGLN(0, ("lxrdp_get_wait_objs: freerdp_get_fds failed")); return 1; } return 0; } /******************************************************************************/ static int lxrdp_check_wait_objs(struct mod *mod) { boolean ok; LLOGLN(12, ("lxrdp_check_wait_objs:")); ok = freerdp_check_fds(mod->inst); if (!ok) { LLOGLN(0, ("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 void lfreerdp_begin_paint(rdpContext *context) { struct mod *mod; LLOGLN(12, ("lfreerdp_begin_paint:")); mod = ((struct mod_context *)context)->modi; mod->server_begin_update(mod); } /******************************************************************************/ static void lfreerdp_end_paint(rdpContext *context) { struct mod *mod; LLOGLN(12, ("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; LLOGLN(12, ("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; LLOGLN(10, ("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) { LLOGLN(20, ("decompress size : %d", bd->bitmapLength)); if (!bitmap_decompress(bd->bitmapDataStream, (tui8 *)dst_data, bd->width, bd->height, bd->bitmapLength, server_bpp, server_bpp)) { LLOGLN(0, ("Failure to decompress the bitmap")); } } else { /* bitmap is upside down */ LLOGLN(10, ("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; LLOGLN(10, ("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; LLOGLN(10, ("lfreerdp_pat_blt:")); server_bpp = mod->inst->settings->color_depth; client_bpp = mod->bpp; LLOGLN(10, ("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); LLOGLN(10, ("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) { LLOGLN(0, ("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)) { LLOGLN(0, ("lfreerdp_pat_blt: error")); 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; LLOGLN(10, ("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; LLOGLN(10, ("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); LLOGLN(10, ("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; LLOGLN(12, ("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)) { LLOGLN(0, ("lfreerdp_mem_blt: bad id [%d]", id)); return; } if ((idx < 0) || (idx >= 4096)) { LLOGLN(0, ("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; LLOGLN(10, ("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); LLOGLN(10, ("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; LLOGLN(10, ("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) { LLOGLN(0, ("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) { LLOGLN(0, ("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; LLOGLN(10, ("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 */ { LLOGLN(10, ("lfreerdp_cache_bitmapV2: CBR2_DO_NOT_CACHE")); idx = 4096 - 1; } if ((id < 0) || (id >= 4)) { LLOGLN(0, ("lfreerdp_cache_bitmapV2: bad id [%d]", id)); return; } if ((idx < 0) || (idx >= 4096)) { LLOGLN(0, ("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); LLOGLN(10, ("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; LLOGLN(10, ("lfreerdp_cache_glyph: %d", cache_glyph_order->cGlyphs)); for (index = 0; index < cache_glyph_order->cGlyphs; index++) { gd = cache_glyph_order->glyphData[index]; LLOGLN(10, (" %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; LLOGLN(10, ("lfreerdp_cache_brush: bpp %d cx %d cy %d idx %d bytes %d", bpp, cx, cy, idx, bytes)); if ((idx < 0) || (idx >= 64)) { LLOGLN(0, ("lfreerdp_cache_brush: error idx %d", idx)); return; } if ((bpp != 1) || (cx != 8) || (cy != 8)) { LLOGLN(0, ("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) { LLOGLN(0, ("lfreerdp_cache_brush: bytes to big %d", bytes)); bytes = 8; } g_memcpy(mod->brush_cache[idx].data, cache_brush_order->data, bytes); } LLOGLN(10, ("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) { LLOGLN(0, ("lfreerdp_pointer_position: - no code here")); } /******************************************************************************/ static void lfreerdp_pointer_system(rdpContext *context, POINTER_SYSTEM_UPDATE *pointer_system) { LLOGLN(0, ("lfreerdp_pointer_system: - no code here type value = %d", pointer_system->type)); } /******************************************************************************/ static void lfreerdp_pointer_color(rdpContext *context, POINTER_COLOR_UPDATE *pointer_color) { LLOGLN(0, ("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 { LLOGLN(0, ("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 { LLOGLN(0, ("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; LLOGLN(20, ("lfreerdp_pointer_new:")); LLOGLN(20, (" bpp %d", pointer_new->xorBpp)); LLOGLN(20, (" width %d height %d", pointer_new->colorPtrAttr.width, pointer_new->colorPtrAttr.height)); LLOGLN(20, (" lengthXorMask %d lengthAndMask %d", pointer_new->colorPtrAttr.lengthXorMask, pointer_new->colorPtrAttr.lengthAndMask)); index = pointer_new->colorPtrAttr.cacheIndex; if (index >= 32) { LLOGLN(0, ("lfreerdp_pointer_new: pointer index too big")); return ; } if (pointer_new->xorBpp == 1 && pointer_new->colorPtrAttr.width == 32 && pointer_new->colorPtrAttr.height == 32) { LLOGLN(10, ("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; LLOGLN(10, ("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 { LLOGLN(0, ("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; LLOGLN(10, ("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) { LLOGLN(0, ("lfreerdp_polygon_sc called:- not supported!!!!!!!!!!!!!!!!!!!!")); } /******************************************************************************/ static void lfreerdp_polygon_sc(rdpContext *context, POLYGON_SC_ORDER *polygon_sc) { struct mod *mod; int i, npoints; struct { short x, y; } points[4]; int fgcolor; int server_bpp, client_bpp; mod = ((struct mod_context *)context)->modi; LLOGLN(10, ("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 { LLOGLN(0, ("Not handled number of points in lfreerdp_polygon_sc")); } } /******************************************************************************/ static void lfreerdp_synchronize(rdpContext *context) { struct mod *mod; mod = ((struct mod_context *)context)->modi; LLOGLN(12, ("lfreerdp_synchronize received - not handled")); } /******************************************************************************/ static boolean lfreerdp_pre_connect(freerdp *instance) { struct mod *mod; int index; int error; int num_chans; int ch_flags; char ch_name[256]; char *dst_ch_name; LLOGLN(0, ("lfreerdp_pre_connect:")); mod = ((struct mod_context *)(instance->context))->modi; verifyColorMap(mod); num_chans = 0; index = 0; error = mod->server_query_channel(mod, index, ch_name, &ch_flags); while (error == 0) { num_chans++; LLOGLN(10, ("lfreerdp_pre_connect: got channel [%s], id [%d], flags [0x%8.8x]", ch_name, index, ch_flags)); dst_ch_name = instance->settings->channels[index].name; g_memset(dst_ch_name, 0, 8); g_snprintf(dst_ch_name, 8, "%s", ch_name); instance->settings->channels[index].options = ch_flags; index++; error = mod->server_query_channel(mod, index, ch_name, &ch_flags); } instance->settings->num_channels = num_chans; 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)) { LLOGLN(0, ("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 { LLOGLN(10, ("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; } instance->settings->compression = 0; instance->settings->ignore_certificate = 1; // Multi Monitor Settings instance->settings->num_monitors = mod->client_info.monitorCount; for (index = 0; index < mod->client_info.monitorCount; index++) { instance->settings->monitors[index].x = mod->client_info.minfo[index].left; instance->settings->monitors[index].y = mod->client_info.minfo[index].top; instance->settings->monitors[index].width = mod->client_info.minfo[index].right; instance->settings->monitors[index].height = mod->client_info.minfo[index].bottom; instance->settings->monitors[index].is_primary = mod->client_info.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; LLOGLN(10, ("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); } LLOGLN(10, ("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) { LLOGLN(10, ("lrail_WindowUpdate:")); lrail_WindowCreate(context, orderInfo, window_state); } /*****************************************************************************/ void lrail_WindowDelete(rdpContext *context, WINDOW_ORDER_INFO *orderInfo) { struct mod *mod; LLOGLN(10, ("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; LLOGLN(10, ("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; LLOGLN(10, ("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; LLOGLN(10, ("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) { LLOGLN(10, ("lrail_NotifyIconUpdate:")); lrail_NotifyIconCreate(context, orderInfo, notify_icon_state); } /*****************************************************************************/ void lrail_NotifyIconDelete(rdpContext *context, WINDOW_ORDER_INFO *orderInfo) { struct mod *mod; LLOGLN(10, ("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; LLOGLN(10, ("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; LLOGLN(10, ("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; LLOGLN(10, ("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) { LLOGLN(0, ("lfreerdp_context_new: %p", context)); } /******************************************************************************/ static void lfreerdp_context_free(freerdp *instance, rdpContext *context) { LLOGLN(0, ("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) { LLOGLN(10, ("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) { LLOGLN(0, ("lfreerdp_receive_channel_data: error %d", error)); } } else { LLOGLN(0, ("lfreerdp_receive_channel_data: bad lchid")); } return 0; } /******************************************************************************/ static boolean lfreerdp_authenticate(freerdp *instance, char **username, char **password, char **domain) { LLOGLN(0, ("lfreerdp_authenticate: - no code here")); return 1; } /******************************************************************************/ static boolean lfreerdp_verify_certificate(freerdp *instance, char *subject, char *issuer, char *fingerprint) { LLOGLN(0, ("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; LLOGLN(10, ("lfreerdp_session_info:")); error = 0; mod = ((struct mod_context *)(instance->context))->modi; if (mod != 0) { LLOGLN(10, ("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; LLOGLN(0, ("mod_init:")); mod = (struct mod *)g_malloc(sizeof(struct mod), 1); freerdp_get_version(&(mod->vmaj), &(mod->vmin), &(mod->vrev)); LLOGLN(0, (" 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->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; LLOGLN(10, ("mod_init: mod %p", mod)); return (tintptr) mod; } /******************************************************************************/ int EXPORT_CC mod_exit(tintptr handle) { struct mod *mod = (struct mod *) handle; LLOGLN(0, ("mod_exit:")); if (mod == 0) { return 0; } if (mod->inst == NULL) { LLOGLN(0, ("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.9.12/neutrinordp/xrdp-color.c000644 001751 001751 00000020004 13544635323 017312 0ustar00metameta000000 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" 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; } g_writeln("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; } g_writeln("convert_color: error unknown conversion from %d to %d", in_bpp, out_bpp); return 0; } xrdp-0.9.12/neutrinordp/Makefile.am000644 001751 001751 00000001113 13544635323 017111 0ustar00metameta000000 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) if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif 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.9.12/neutrinordp/Makefile.in000644 001751 001751 00000054022 13601646126 017126 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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) $(am__append_1) 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: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/vrplayer/mediapacket.cpp000644 001751 001751 00000000153 13544635323 017326 0ustar00metameta000000 000000 #include "mediapacket.h" MediaPacket::MediaPacket() { av_pkt = 0; delay_in_us = 0; seq = 0; } xrdp-0.9.12/vrplayer/playvideo.h000644 001751 001751 00000003120 13544635323 016515 0ustar00metameta000000 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: 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.9.12/vrplayer/decoder.h000644 001751 001751 00000001223 13544635323 016130 0ustar00metameta000000 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: void onGeometryChanged(QRect *geometry); }; #endif // DECODER_H xrdp-0.9.12/vrplayer/decoderthread.h000644 001751 001751 00000004060 13544635323 017322 0ustar00metameta000000 000000 #ifndef DECODERTHREAD_H #define DECODERTHREAD_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 /* ffmpeg related stuff */ extern "C" { #include #include } class DecoderThread : public QObject { Q_OBJECT public: /* public methods */ DecoderThread(); void setFilename(QString filename); void stopPlayer(); void pausePlayer(); void resumePlayer(); void oneTimeDeinit(); void close(); void run(); void startMediaPlay(); public slots: void on_mediaSeek(int value); private: /* private variables */ QQueue audioQueue; QQueue videoQueue; QTimer *videoTimer; QTimer *audioTimer; QTimer *pktTimer; QString filename; void *channel; int stream_id; QRect geometry; int64_t elapsedTime; /* elapsed time in usecs since play started */ QMutex mutex; int64_t la_seekPos; /* locked access; must hold mutex */ PlayVideo *playVideo; QThread *playVideoThread; PlayAudio *playAudio; QThread *playAudioThread; /* private functions */ int sendMetadataFile(); int sendAudioFormat(); int sendVideoFormat(); int sendGeometry(); void updateSlider(); private slots: /* private slots */ void audioTimerCallback(); void videoTimerCallback(); void pktTimerCallback(); signals: /* private signals */ void on_progressUpdate(int percent); void on_decoderErrorMsg(QString title, QString msg); void on_mediaDurationInSeconds(int duration); void on_elapsedtime(int val); /* in hundredth of a sec */ }; #endif // DECODERTHREAD_H xrdp-0.9.12/vrplayer/dlgabout.h000644 001751 001751 00000000464 13544635323 016332 0ustar00metameta000000 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: void onOk(); }; #endif // DLGABOUT_H xrdp-0.9.12/vrplayer/ourinterface.h000644 001751 001751 00000003113 13544635323 017211 0ustar00metameta000000 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.9.12/vrplayer/mediapacket.h000644 001751 001751 00000000261 13544635323 016773 0ustar00metameta000000 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.9.12/vrplayer/README.txt000644 001751 001751 00000001220 13544635323 016045 0ustar00metameta000000 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.9.12/vrplayer/mainwindow.cpp000644 001751 001751 00000034307 13544635323 017243 0ustar00metameta000000 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.9.12/vrplayer/main.cpp000644 001751 001751 00000000360 13544635323 016003 0ustar00metameta000000 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.9.12/vrplayer/demuxmedia.h000644 001751 001751 00000003114 13544635323 016646 0ustar00metameta000000 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.9.12/vrplayer/demuxmedia.cpp000644 001751 001751 00000007373 13544635323 017214 0ustar00metameta000000 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.9.12/vrplayer/mainwindow.h000644 001751 001751 00000005535 13544635323 016711 0ustar00metameta000000 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.9.12/vrplayer/playvideo.cpp000644 001751 001751 00000002716 13544635323 017062 0ustar00metameta000000 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.9.12/vrplayer/decoderthread.cpp000644 001751 001751 00000014673 13544635323 017670 0ustar00metameta000000 000000 // not used #include "decoderthread.h" /* * TODO: * o need to maintain aspect ratio while resizing * o clicking in the middle of the slider bar should move the slider to the middle * o need to be able to rewind the move when it is done playing * o need to be able to load another move and play it w/o restarting player * o pause button needs to work * o need images for btns */ DecoderThread::DecoderThread() { channel = NULL; geometry.setX(0); geometry.setY(0); geometry.setWidth(0); geometry.setHeight(0); stream_id = 101; elapsedTime = 0; la_seekPos = -1; videoTimer = NULL; audioTimer = NULL; } void DecoderThread::run() { /* need a media file */ if (filename.length() == 0) { emit on_decoderErrorMsg("No media file", "Please select a media file to play"); return; } } void DecoderThread::startMediaPlay() { MediaPacket *mediaPkt; int is_video_frame; int rv; /* setup video timer; each time this timer fires, it sends */ /* one video pkt to the client then resets the callback duration */ videoTimer = new QTimer; connect(videoTimer, SIGNAL(timeout()), this, SLOT(videoTimerCallback())); //videoTimer->start(1500); /* setup audio timer; does the same as above, but with audio pkts */ audioTimer = new QTimer; connect(audioTimer, SIGNAL(timeout()), this, SLOT(audioTimerCallback())); //audioTimer->start(500); /* setup pktTimer; each time this timer fires, it reads AVPackets */ /* and puts them into audio/video Queues */ pktTimer = new QTimer; connect(pktTimer, SIGNAL(timeout()), this, SLOT(pktTimerCallback())); while (1) { /* fill the audio/video queues with initial data; thereafter */ /* data will be filled by pktTimerCallback() */ if ((audioQueue.count() >= 3000) || (videoQueue.count() >= 3000)) { //pktTimer->start(50); //videoTimer->start(1500); //audioTimer->start(500); playVideo = new PlayVideo(NULL, &videoQueue, channel, 101); playVideoThread = new QThread(this); connect(playVideoThread, SIGNAL(started()), playVideo, SLOT(play())); playVideo->moveToThread(playVideoThread); playVideoThread->start(); playAudio = new PlayAudio(NULL, &audioQueue, channel, 101); playAudioThread = new QThread(this); connect(playAudioThread, SIGNAL(started()), playAudio, SLOT(play())); playAudio->moveToThread(playAudioThread); playAudioThread->start(); return; } 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 */ break; } if (is_video_frame) videoQueue.enqueue(mediaPkt); else audioQueue.enqueue(mediaPkt); } /* end while (1) */ } void DecoderThread::on_mediaSeek(int value) { mutex.lock(); la_seekPos = value; mutex.unlock(); qDebug() << "media seek value=" << value; /* pktTimer stops at end of media; need to restart it */ if (!pktTimer->isActive()) { updateSlider(); pktTimer->start(100); } } void DecoderThread::setFilename(QString filename) { this->filename = filename; } void DecoderThread::stopPlayer() { pktTimer->stop(); audioQueue.clear(); videoQueue.clear(); } void DecoderThread::pausePlayer() { pktTimer->stop(); } void DecoderThread::resumePlayer() { pktTimer->start(100); } void DecoderThread::close() { } void DecoderThread::audioTimerCallback() { MediaPacket *pkt; int delayInMs; if (audioQueue.isEmpty()) { qDebug() << "audioTimerCallback: got empty"; audioTimer->setInterval(100); return; } pkt = audioQueue.dequeue(); delayInMs = (int) ((float) pkt->delay_in_us / 1000.0); send_audio_pkt(channel, 101, pkt->av_pkt); delete pkt; //qDebug() << "audioTimerCallback: delay :" << delayInMs; audioTimer->setInterval(delayInMs); } void DecoderThread::videoTimerCallback() { MediaPacket *pkt; int delayInMs; if (videoQueue.isEmpty()) { qDebug() << "videoTimerCallback: GOT EMPTY"; videoTimer->setInterval(100); return; } pkt = videoQueue.dequeue(); delayInMs = (int) 10; // ((float) pkt->delay_in_us / 1000.0); send_video_pkt(channel, 101, pkt->av_pkt); delete pkt; updateSlider(); //qDebug() << "videoTimerCallback: delay :" << delayInMs; videoTimer->setInterval(delayInMs); } void DecoderThread::pktTimerCallback() { MediaPacket *mediaPkt; int is_video_frame; int rv; while (1) { qDebug() << "pktTimerCallback: audioCount=" << audioQueue.count() << "videoCount=" << videoQueue.count(); #if 1 if ((audioQueue.count() >= 20) || (videoQueue.count() >= 20)) return; #else if (videoQueue.count() >= 60) return; #endif 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 */ qDebug() << "###### looks like we reached EOF"; pktTimer->stop(); // LK_TODO set some flag so audio/video timer also stop when q is empty return; } if (is_video_frame) videoQueue.enqueue(mediaPkt); else audioQueue.enqueue(mediaPkt); } } void DecoderThread::updateSlider() { if (elapsedTime == 0) elapsedTime = av_gettime(); /* time elapsed in 1/100th sec units since play started */ emit on_elapsedtime((av_gettime() - elapsedTime) / 10000); mutex.lock(); if (la_seekPos >= 0) { qDebug() << "seeking to" << la_seekPos; //audioTimer->stop(); //videoTimer->stop(); xrdpvr_seek_media(la_seekPos, 0); elapsedTime = av_gettime() - la_seekPos * 1000000; //audioTimer->start(10); //videoTimer->start(10); la_seekPos = -1; } mutex.unlock(); } xrdp-0.9.12/vrplayer/decoder.cpp000644 001751 001751 00000003675 13544635323 016500 0ustar00metameta000000 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.9.12/vrplayer/playaudio.h000644 001751 001751 00000002177 13544635323 016523 0ustar00metameta000000 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: void play(); private: QQueue *audioQueue; QMutex *sendMutex; QMutex vcrMutex; int vcrFlag; void *channel; int stream_id; void clearAudioQ(); }; #endif // PLAYAUDIO_H xrdp-0.9.12/vrplayer/playaudio.cpp000644 001751 001751 00000003453 13544635323 017054 0ustar00metameta000000 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.9.12/vrplayer/dlgabout.ui000644 001751 001751 00000001641 13544635323 016516 0ustar00metameta000000 000000 DlgAbout 0 0 288 168 Dialog 70 60 151 17 VRPlayer v1.6 180 120 94 27 OK xrdp-0.9.12/vrplayer/vrplayer.pro000644 001751 001751 00000001465 13544635323 016750 0ustar00metameta000000 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.9.12/vrplayer/mainwindow.ui000644 001751 001751 00000003502 13544635323 017067 0ustar00metameta000000 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.9.12/vrplayer/ourinterface.cpp000644 001751 001751 00000013457 13544635323 017560 0ustar00metameta000000 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; //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.9.12/vrplayer/dlgabout.cpp000644 001751 001751 00000000471 13544635323 016663 0ustar00metameta000000 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.9.12/docs/Makefile.am000644 001751 001751 00000000023 13544635323 015467 0ustar00metameta000000 000000 SUBDIRS = \ man xrdp-0.9.12/docs/Makefile.in000644 001751 001751 00000046063 13601646125 015512 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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)` ETAGS = etags CTAGS = ctags 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-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: xrdp-0.9.12/docs/man/000755 001751 001751 00000000000 13601646134 014207 5ustar00metameta000000 000000 xrdp-0.9.12/docs/man/Makefile.in000644 001751 001751 00000047765 13601646125 016277 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 EXTRA_DIST = $(man_MANS:=.in) SUBST_VARS = sed \ -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@socketdir[@]|$(socketdir)|g' \ -e 's|@xrdpconfdir[@]|$(sysconfdir)/xrdp|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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/docs/man/xrdp-sesadmin.8.in000644 001751 001751 00000002130 13544635323 017463 0ustar00metameta000000 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 \fIUsername\fP for authentication on the server. Defaults to \fBroot\fP. .TP .BI \-p= password The \fIpassword\fP to authenticate with. The default is to ask for the password interactively. .TP .BI \-s= server The host address of the \fIserver\fP to connect to. Defaults to \fBlocalhost\fP. .TP .BI \-i= port The TCP \fIport\fP number to connect to. Defaults to \fB3350\fP. .TP .BI \-c= command Specifies the \fIcommand\fP to execute on the server. Valid commands are: .RS 4 .TP .B list List currently active sessions. .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). xrdp-0.9.12/docs/man/xrdp-dis.1.in000644 001751 001751 00000001037 13544635323 016435 0ustar00metameta000000 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 with the \fBxrdp\fP(8) session manager. .SH KNOWN ISSUES .TP This utility doesn't support disconnecting xorgxrdp sessions so far. .SH SEE ALSO .BR xrdp (8). xrdp-0.9.12/docs/man/xrdp-sesman.8.in000644 001751 001751 00000002016 13544635323 017151 0ustar00metameta000000 000000 .TH "xrdp\-sesman" "8" "@PACKAGE_VERSION@" "xrdp team" "" .SH "NAME" xrdp\-sesman \- \fBxrdp\fR(8) session manager .SH "SYNTAX" .B xrdp\-sesman .RB [ \-\-nodaemon | \-\-kill | \-\-help ] .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\-n\fR, \fB\-\-nodaemon\fR Starts \fBxrdp\-sesman\fR in foreground instead of starting it as a daemon. .TP \fB\-k\fR, \fB\-\-kill\fR Kills running \fBxrdp\-sesman\fR daemon. .TP \fB\-h\fR, \fB\-\-help\fR Output help information and exit. .SH "FILES" @bindir@/xrdp\-sesman .br @bindir@/xrdp\-sesrun .br @sysconfdir@/xrdp/sesman.ini .br @localstatedir@/log/xrdp\-sesman.log .br @localstatedir@/run/xrdp\-sesman.pid .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 http://www.xrdp.org/ xrdp-0.9.12/docs/man/Makefile.am000644 001751 001751 00000001317 13544635323 016251 0ustar00metameta000000 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 EXTRA_DIST = $(man_MANS:=.in) SUBST_VARS = sed \ -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@socketdir[@]|$(socketdir)|g' \ -e 's|@xrdpconfdir[@]|$(sysconfdir)/xrdp|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.9.12/docs/man/xrdp-keygen.8.in000644 001751 001751 00000002262 13544635323 017150 0ustar00metameta000000 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.9.12/docs/man/xrdp.8.in000644 001751 001751 00000002454 13544635323 015673 0ustar00metameta000000 000000 .TH "xrdp" "8" "@PACKAGE_VERSION@" "xrdp team" "" .SH "NAME" \fBxrdp\fR \- a Remote Desktop Protocol (RDP) server .SH "SYNTAX" xrdp [ \-\-nodaemon | \-\-kill | \-\-help ] .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\-n\fR, \fB\-\-nodaemon\fR Start \fBxrdp\fR in foreground instead of starting it as a daemon. .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\-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. .SH "FILES" @bindir@/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 http://www.xrdp.org/ xrdp-0.9.12/docs/man/xrdp-chansrv.8.in000644 001751 001751 00000002127 13544635323 017332 0ustar00metameta000000 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. This program is only forked internally by \fBxrdp\-sesman\fP(8). .br Currently \fBxrdp\-chansrv\fP knows about the following channels: .RE 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 .RS .SH FILES .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 $XDG_DATA_HOME/xrdp/xrdp-chansrv.%s.log Log file used by \fBxrdp\-chansrv\fP(8). \fB%s\fP is display number. .SH "SEE ALSO" .BR xrdp\-sesman (8), .BR sesman.ini (5). for more info on \fBxrdp\fR see http://www.xrdp.org/ xrdp-0.9.12/docs/man/xrdp.ini.5.in000644 001751 001751 00000027420 13544635323 016446 0ustar00metameta000000 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 \fBaddress\fP=\fIip address\fP Specify xrdp listening address. If not specified, defaults to 0.0.0.0 (all interfaces). .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 text passed to PAM when authentication failed. The maximum length is \fB256\fP. .TP \fBport\fP=\fIport\fP Specify TCP port to listen on for incoming connections. The default for RDP is \fB3389\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. 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 operating system. .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). .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.\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 \fBsesman\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. .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 and X11rdp use that setting. Xorg runs at \fI24\fR bpp. .TP \fBcode\fR=\fI\fR|\fI0\fR Specifies the session type. The default, \fI0\fR, is Xvnc, \fI10\fR is X11rdp, and \fI20\fR is Xorg with xorgxrdp modules. .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 sesman (8), .BR sesrun (8), .BR sesman.ini (5) for more info on \fBxrdp\fR see http://www.xrdp.org/ xrdp-0.9.12/docs/man/xrdp-sesrun.8.in000644 001751 001751 00000001713 13544635323 017205 0ustar00metameta000000 000000 .TH "xrdp\-sesrun" "8" "@PACKAGE_VERSION@" "xrdp team" "" .SH "NAME" xrdp\-sesrun \- \fBsesman\fR(8) session launcher .SH "SYNTAX" .B xrdp\-sesrun .I server username password width height bpp .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. .SH "OPTIONS" .TP .I server Server on which sesman is running .TP .I username user name of the session being started .TP .I password user password .TP .I width Screen width .TP .I height Screen height .TP .I bpp Session color depth .SH "FILES" @bindir@/xrdp\-sesman .br @bindir@/xrdp\-sesrun .SH "AUTHORS" Jay Sorg .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 http://www.xrdp.org/ xrdp-0.9.12/docs/man/xrdp-genkeymap.8.in000644 001751 001751 00000002465 13544635323 017653 0ustar00metameta000000 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), .URL "https://github.com/FreeRDP/FreeRDP/wiki/Keyboard" "Description of Keyboard Input mapping" . for more info on \fBxrdp\fR see http://www.xrdp.org/ xrdp-0.9.12/docs/man/sesman.ini.5.in000644 001751 001751 00000017257 13601643631 016761 0ustar00metameta000000 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[X11rdp]\fR, \fB[Xvnc]\fR, \fB[Xorg]\fR X11 server settings for supported servers .TP \fB[Chansrv]\fR 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 \fBListenAddress\fR=\fIip address\fR xrdp-sesman listening address. If not specified, defaults to \fI0.0.0.0\fR (all interfaces). .TP \fBListenPort\fR=\fIport number\fR xrdp-sesman listening port. If not specified, defaults to \fI3350\fR. .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 section. .TP \fBLogFile\fR=\fIfilename\fR Log file path. It can be either absolute or relative. If not specified, defaults to \fI./sesman.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. If \fBSyslogLevel\fR and \fBLogLevel\fR differ, the least verbose setting takes effect for syslog. .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 \fBKillDisconnected\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, every session will be killed within 60 seconds after the user disconnects. .TP \fBDisconnectedTimeLimit\fR=\fInumber\fR Sets the time limit (in seconds) before a disconnected session is killed. If set to \fI0\fR, automatic killing is disabled. .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 session. Moreover, xorgxrdp must be v0.2.9 or later. .TP \fBPolicy\fR=\fI[Default|UBD|UBI|UBC|UBDI|UBDC]\fR Session allocation policy. By default, a new session is created for the combination when using Xrdp, and for the combination when using Xvnc. This behavior can be changed by setting session policy to: .br .br \fBUBD\fR - session per .br \fBUBI\fR - session per .br \fBUBC\fR - session per .br \fBUBDI\fR - session per .br \fBUBDC\fR - session per .br .br Note that the \fBUser\fR and \fBBitPerPixel\fR criteria cannot be turned off. For Xvnc connections, \fBDisplaySize\fR is always enabled as well. .br .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[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, will restrict the clipboard outbound from the server, to prevent data copied inside the xrdp session to be be pasted in the client host. Default value is \fBfalse\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. .SH "X11 SERVER" Following parameters can be used in the \fB[X11rdp]\fR, \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, relative to the user home directory. Created if it doesn't exist. If not specified, defaults to \fIxrdp_client\fR. .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 approprate for all environents, and so you can change this value to allow other users to access your remote files if required. .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 http://www.xrdp.org/ xrdp-0.9.12/pkgconfig/xrdp-uninstalled.pc.in000644 001751 001751 00000000274 13544635323 020710 0ustar00metameta000000 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.9.12/pkgconfig/xrdp.pc.in000644 001751 001751 00000000312 13544635323 016361 0ustar00metameta000000 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.9.12/pkgconfig/Makefile.in000644 001751 001751 00000036627 13601646126 016537 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/pkgconfig/Makefile.am000644 001751 001751 00000000067 13544635323 016516 0ustar00metameta000000 000000 pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA = xrdp.pc xrdp-0.9.12/xup/xup.c000644 001751 001751 00000125315 13601643631 014306 0ustar00metameta000000 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" #define LOG_LEVEL 1 #define LLOG(_level, _args) \ do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0) #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { g_writeln _args ; } } while (0) 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) { LIB_DEBUG(mod, "in lib_mod_start"); mod->width = w; mod->height = h; mod->bpp = bpp; LIB_DEBUG(mod, "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_message(LOG_LEVEL_INFO, "lib_mod_log_peer: xrdp_pid=%d connected " "to X11rdp_pid=%d X11rdp_uid=%d X11rdp_gid=%d " "client_ip=%s client_port=%s", my_pid, pid, uid, gid, mod->client_info.client_addr, mod->client_info.client_port); } else { log_message(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; LLOGLN(10, ("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) { g_writeln("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) { g_writeln("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 len; int i; int use_uds; struct stream *s; char con_port[256]; struct source_info *si; LIB_DEBUG(mod, "in lib_mod_connect"); 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); LIB_DEBUG(mod, "out lib_mod_connect error"); return 1; } if (g_strcmp(mod->ip, "") == 0) { mod->server_msg(mod, "error - no ip set", 0); LIB_DEBUG(mod, "out lib_mod_connect error"); return 1; } make_stream(s); g_sprintf(con_port, "%s", mod->port); use_uds = 0; if (con_port[0] == '/') { use_uds = 1; } error = 0; mod->sck_closed = 0; i = 0; if (use_uds) { mod->trans = trans_create(TRANS_MODE_UNIX, 8 * 8192, 8192); if (mod->trans == 0) { free_stream(s); return 1; } } else { mod->trans = trans_create(TRANS_MODE_TCP, 8 * 8192, 8192); if (mod->trans == 0) { free_stream(s); return 1; } } si = (struct source_info *) (mod->si); mod->trans->si = si; mod->trans->my_source = XRDP_SOURCE_MOD; while (1) { /* mod->server_msg(mod, "connecting...", 0); */ error = -1; if (trans_connect(mod->trans, mod->ip, con_port, 3000) == 0) { LLOGLN(0, ("lib_mod_connect: connected to Xserver " "(Xorg or X11rdp) sck %lld", (long long) (mod->trans->sck))); error = 0; } if (error == 0) { break; } if (mod->server_is_term(mod)) { break; } i++; if (i >= 60) { mod->server_msg(mod, "connection problem, giving up", 0); break; } g_sleep(500); } if (error == 0) { if (use_uds) { lib_mod_log_peer(mod); } } if (error == 0) { /* 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); len = (int)(s->end - s->data); s_pop_layer(s, iso_hdr); out_uint32_le(s, len); lib_send_copy(mod, s); } if (error == 0) { /* send screen size message */ init_stream(s, 8192); s_push_layer(s, iso_hdr, 4); out_uint16_le(s, 103); out_uint32_le(s, 300); out_uint32_le(s, mod->width); out_uint32_le(s, mod->height); out_uint32_le(s, mod->bpp); out_uint32_le(s, 0); 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 (error == 0) { /* 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 */ i = 0; out_uint32_le(s, i); /* width and height */ i = ((mod->width & 0xffff) << 16) | mod->height; out_uint32_le(s, i); out_uint32_le(s, 0); out_uint32_le(s, 0); 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); if (error != 0) { trans_delete(mod->trans); mod->trans = 0; mod->server_msg(mod, "some problem", 0); LIB_DEBUG(mod, "out lib_mod_connect error"); 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; } LIB_DEBUG(mod, "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; LIB_DEBUG(mod, "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) { g_writeln("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); LIB_DEBUG(mod, "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) { 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 (flags == 0) /* screen */ { 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_rects(amod, num_drects, ldrects, num_crects, lcrects, bmpdata, width, height, flags, frame_id); } else { rv = 1; } //g_writeln("frame_id %d", frame_id); //send_paint_rect_ex_ack(amod, flags, frame_id); g_free(lcrects); g_free(ldrects); return rv; } /******************************************************************************/ /* return error */ static int lib_mod_process_orders(struct mod *mod, int type, struct stream *s) { int rv; LLOGLN(10, ("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; default: g_writeln("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; g_writeln("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; LLOGLN(10, ("lib_mod_process_message:")); rv = 0; if (rv == 0) { in_uint16_le(s, type); in_uint16_le(s, num_orders); in_uint32_le(s, len); LLOGLN(10, ("lib_mod_process_message: type %d", type)); 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 */ { g_writeln("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: g_writeln("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 */ { 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 { g_writeln("unknown type %d", type); } } return rv; } /******************************************************************************/ /* return error */ int lib_mod_signal(struct mod *mod) { g_writeln("lib_mod_signal: not used"); 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, 255); } else if (g_strcasecmp(name, "password") == 0) { g_strncpy(mod->password, value, 255); } 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); } } return rv; } /******************************************************************************/ /* return error */ int lib_mod_frame_ack(struct mod *amod, int flags, int frame_id) { LLOGLN(10, ("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) { LLOGLN(10, ("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; 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.9.12/xup/Makefile.in000644 001751 001751 00000052574 13601646126 015403 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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__append_1) 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: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/xup/xup.h000644 001751 001751 00000017335 13544635324 014323 0ustar00metameta000000 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 */ /* include other h files */ #include "arch.h" #include "parse.h" #include "os_calls.h" #include "defines.h" #include "xrdp_client_info.h" #include "xrdp_rail.h" #define CURRENT_MOD_VER 4 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); tintptr mod_dumby[100 - 11]; /* 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)(struct mod* v); 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 (*server_reset)(struct mod* v, int width, int height, int bpp); 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); /* 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); tintptr server_dumby[100 - 43]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as long */ tintptr wm; tintptr painter; tintptr si; /* mod data */ int width; int height; int bpp; int sck_closed; char username[256]; char password[256]; 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; }; xrdp-0.9.12/xup/Makefile.am000644 001751 001751 00000000705 13544635324 015363 0ustar00metameta000000 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 if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif 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.9.12/libxrdp/xrdp_bitmap32_compress.c000644 001751 001751 00000035653 13544635323 020725 0ustar00metameta000000 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 #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do { if (_level < LLOG_LEVEL) { g_writeln _args ; } } while (0) #define LHEXDUMP(_level, _args) \ do { if (_level < LLOG_LEVEL) { g_hexdump _args ; } } while (0) /*****************************************************************************/ /* 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; LLOGLN(10, ("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; } LLOGLN(10, ("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; 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 = plane + jndex * cx; LHEXDUMP(10, (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; LLOGLN(10, ("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.9.12/libxrdp/xrdp_fastpath.c000644 001751 001751 00000023616 13544635323 017177 0ustar00metameta000000 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" /*****************************************************************************/ struct xrdp_fastpath * xrdp_fastpath_create(struct xrdp_sec *owner, struct trans *trans) { struct xrdp_fastpath *self; DEBUG((" in xrdp_fastpath_create")); self = (struct xrdp_fastpath *)g_malloc(sizeof(struct xrdp_fastpath), 1); self->sec_layer = owner; self->trans = trans; self->session = owner->rdp_layer->session; DEBUG((" out xrdp_fastpath_create")); 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; /* unused */ int byte; char *holdp; DEBUG((" in xrdp_fastpath_recv")); holdp = s->p; if (!s_check_rem(s, 2)) { 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(s, 1)) { return 1; } in_uint8(s, byte); /* length 2 (1 byte) */ len += byte; } else { len = byte; } s->next_packet = holdp + len; DEBUG((" out xrdp_fastpath_recv")); 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); } 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; } 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(s, 1)) { return 1; } in_uint8(s, code); /* keyCode (1 byte) */ 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(s, 2 + 2 + 2)) { 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) */ 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(s, 2 + 2 + 2)) { 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) */ 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. */ 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(s, 2)) { return 1; } in_uint16_le(s, code); /* unicode (2 byte) */ 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(s, 1)) { return 1; } in_uint8(s, eventHeader); eventFlags = (eventHeader & 0x1F); eventCode = (eventHeader >> 5); 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: g_writeln("xrdp_fastpath_process_input_event: unknown " "eventCode %d", eventCode); break; } } return 0; } xrdp-0.9.12/libxrdp/xrdp_jpeg_compress.c000644 001751 001751 00000031664 13544635323 020227 0ustar00metameta000000 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) { g_writeln("xrdp_jpeg_compress: bpp wrong %d", bpp); return height; } if (handle == 0) { g_writeln("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_message(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) { g_writeln("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_message(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 { g_writeln("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.9.12/libxrdp/Makefile.am000644 001751 001751 00000002266 13544635323 016216 0ustar00metameta000000 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_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif 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_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.9.12/libxrdp/libxrdp.c000644 001751 001751 00000142247 13544635323 015776 0ustar00metameta000000 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 "xrdp_orders_rail.h" #define LOG_LEVEL 1 #define LLOG(_level, _args) \ do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0) #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { g_writeln _args ; } } while (0) #define MAX_BITMAP_BUF_SIZE (16 * 1024) /* 16K */ /******************************************************************************/ struct xrdp_session *EXPORT_CC libxrdp_init(tbus id, struct trans *trans) { struct xrdp_session *session; session = (struct xrdp_session *)g_malloc(sizeof(struct xrdp_session), 1); session->id = id; session->trans = trans; 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); 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); 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) { g_writeln("libxrdp_force_read: error"); return 0; } bytes = libxrdp_get_pdu_bytes(s->data); if (bytes < 1) { g_writeln("libxrdp_force_read: error"); return 0; } if (bytes > 32 * 1024) { g_writeln("libxrdp_force_read: error"); return 0; } if (trans_force_read(trans, bytes - 4) != 0) { g_writeln("libxrdp_force_read: error"); return 0; } 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) { g_writeln("libxrdp_process_data: error logic"); return 1; } if (session->in_process_data != 0) { g_writeln("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) { g_writeln("libxrdp_process_data: libxrdp_force_read failed"); rv = 1; break; } } if (xrdp_rdp_recv(rdp, s, &code) != 0) { g_writeln("libxrdp_process_data: xrdp_rdp_recv failed"); rv = 1; break; } DEBUG(("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: xrdp_caps_process_confirm_active(rdp, s); break; case PDUTYPE_DATAPDU: if (xrdp_rdp_process_data(rdp, s) != 0) { DEBUG(("libxrdp_process_data returned non zero")); cont = 0; term = 1; } break; case 2: /* FASTPATH_INPUT_EVENT */ if (xrdp_fastpath_process_input_event(rdp->sec_layer->fastpath_layer, s) != 0) { DEBUG(("libxrdp_process_data returned non zero")); cont = 0; term = 1; } break; default: g_writeln("unknown in libxrdp_process_data: code= %d", code); dead_lock_counter++; break; } if (dead_lock_counter > 100000) { /*This situation can happen and this is a workaround*/ cont = 0; g_writeln("Serious programming error: we were locked in a deadly loop"); g_writeln("Remaining: %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; } DEBUG(("libxrdp_send_palette sending palette")); /* 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 */ { LLOGLN(10, ("libxrdp_send_palette: fastpath")); if (xrdp_rdp_init_fastpath((struct xrdp_rdp *)session->rdp, s) != 0) { free_stream(s); return 1; } } else { LLOGLN(10, ("libxrdp_send_palette: slowpath")); xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s); } /* TS_UPDATE_PALETTE_DATA */ out_uint16_le(s, RDP_UPDATE_PALETTE); out_uint16_le(s, 0); out_uint16_le(s, 256); /* # of colors */ out_uint16_le(s, 0); 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 */ { if (xrdp_rdp_send_fastpath((struct xrdp_rdp *)session->rdp, s, FASTPATH_UPDATETYPE_PALETTE) != 0) { free_stream(s); return 1; } } else { 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; DEBUG(("libxrdp_send_bell sending bell signal")); /* see MS documentation: Server play sound PDU, TS_PLAY_SOUND_PDU_DATA */ make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s) != 0) { free_stream(s); return 1; } out_uint32_le(s, 440); /* frequency */ out_uint32_le(s, 100); /* duration (ms) */ s_mark_end(s); if (xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, RDP_DATA_PDU_PLAY_SOUND) != 0) { 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; LLOGLN(10, ("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; LLOGLN(10, ("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) { LLOGLN(10, ("libxrdp_send_bitmap: compression")); make_stream(temp_s); init_stream(temp_s, 65536); i = 0; if (cy <= height) { i = cy; } while (i > 0) { LLOGLN(10, ("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); 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) { LLOGLN(10, ("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); LLOGLN(10, ("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); LLOGLN(10, ("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 */ } LLOGLN(10, ("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) { LLOGLN(0, ("libxrdp_send_bitmap: error, decompressed " "size too big: %d bytes", j)); } if (bufsize > MAX_BITMAP_BUF_SIZE) { LLOGLN(0, ("libxrdp_send_bitmap: error, compressed size " "too big: %d bytes", bufsize)); } s->p = s->end; } while (total_bufsize < MAX_BITMAP_BUF_SIZE && i > 0); LLOGLN(10, ("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; xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, RDP_DATA_PDU_UPDATE); if (total_bufsize > MAX_BITMAP_BUF_SIZE) { LLOGLN(0, ("libxrdp_send_bitmap: error, total compressed " "size too big: %d bytes", total_bufsize)); } } free_stream(temp_s); } else { LLOGLN(10, ("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) { LLOGLN(0, ("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); 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) { struct stream *s; char *p; tui16 *p16; tui32 *p32; int i; int j; int data_bytes; DEBUG(("libxrdp_send_pointer sending cursor")); if (bpp == 0) { bpp = 24; } /* error check */ if ((session->client_info->pointer_flags & 1) == 0) { if (bpp != 24) { g_writeln("libxrdp_send_pointer: error client does not support " "new cursors and bpp is %d", bpp); return 1; } } if ((bpp == 15) && (bpp != 16) && (bpp != 24) && (bpp != 32)) { g_writeln("libxrdp_send_pointer: error"); return 1; } make_stream(s); init_stream(s, 8192); if (session->client_info->use_fast_path & 1) /* fastpath output supported */ { LLOGLN(10, ("libxrdp_send_pointer: fastpath")); if (xrdp_rdp_init_fastpath((struct xrdp_rdp *)session->rdp, s) != 0) { free_stream(s); return 1; } if ((session->client_info->pointer_flags & 1) == 0) { data_bytes = 3072; } else { data_bytes = ((bpp + 7) / 8) * 32 * 32; out_uint16_le(s, bpp); } } else /* slowpath */ { LLOGLN(10, ("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 */ data_bytes = 3072; } else { out_uint16_le(s, RDP_POINTER_POINTER); out_uint16_le(s, 0); /* pad */ out_uint16_le(s, bpp); data_bytes = ((bpp + 7) / 8) * 32 * 32; } } out_uint16_le(s, cache_idx); /* cache_idx */ out_uint16_le(s, x); out_uint16_le(s, y); out_uint16_le(s, 32); out_uint16_le(s, 32); out_uint16_le(s, 128); out_uint16_le(s, data_bytes); switch (bpp) { //case 15: /* coverity: this is logically dead code */ case 16: p16 = (tui16 *) data; for (i = 0; i < 32; i++) { for (j = 0; j < 32; j++) { out_uint16_le(s, *p16); p16++; } } break; case 24: p = data; for (i = 0; i < 32; i++) { for (j = 0; j < 32; 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 < 32; i++) { for (j = 0; j < 32; j++) { out_uint32_le(s, *p32); p32++; } } break; } out_uint8a(s, mask, 128); /* mask */ 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) { if (xrdp_rdp_send_fastpath((struct xrdp_rdp *)session->rdp, s, FASTPATH_UPDATETYPE_COLOR) != 0) { free_stream(s); return 1; } } else { if (xrdp_rdp_send_fastpath((struct xrdp_rdp *)session->rdp, s, FASTPATH_UPDATETYPE_POINTER) != 0) { free_stream(s); return 1; } } } else { 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; DEBUG(("libxrdp_set_pointer sending cursor index")); make_stream(s); init_stream(s, 8192); if (session->client_info->use_fast_path & 1) /* fastpath output supported */ { LLOGLN(10, ("libxrdp_send_pointer: fastpath")); if (xrdp_rdp_init_fastpath((struct xrdp_rdp *)session->rdp, s) != 0) { free_stream(s); return 1; } } else { LLOGLN(10, ("libxrdp_send_pointer: slowpath")); xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s); out_uint16_le(s, RDP_POINTER_CACHED); out_uint16_le(s, 0); /* pad */ } out_uint16_le(s, cache_idx); /* cache_idx */ s_mark_end(s); if (session->client_info->use_fast_path & 1) /* fastpath output supported */ { if (xrdp_rdp_send_fastpath((struct xrdp_rdp *)session->rdp, s, FASTPATH_UPDATETYPE_CACHED) != 0) { free_stream(s); return 1; } } else { 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, int width, int height, int bpp) { if (session->client_info != 0) { /* older client can't resize */ if (session->client_info->build <= 419) { return 0; } /* if same, don't need to do anything */ if (session->client_info->width == width && session->client_info->height == height && session->client_info->bpp == bpp) { return 0; } session->client_info->width = width; session->client_info->height = height; session->client_info->bpp = bpp; } else { return 1; } /* this will send any lingering orders */ if (xrdp_orders_reset((struct xrdp_orders *)session->orders) != 0) { return 1; } /* shut down the rdp client */ if (xrdp_rdp_send_deactivate((struct xrdp_rdp *)session->rdp) != 0) { return 1; } /* this should do the resizing */ if (xrdp_caps_send_demand_active((struct xrdp_rdp *)session->rdp) != 0) { return 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); } /*****************************************************************************/ /* 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 index, 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) { g_writeln("libxrdp_query_channel - No channel initialized"); return 1 ; } count = mcs->channel_list->count; if (index < 0 || index >= count) { DEBUG(("libxrdp_query_channel - Channel out of range %d", index)); return 1; } channel_item = (struct mcs_channel_item *) list_get_item(mcs->channel_list, index); if (channel_item == 0) { /* this should not happen */ g_writeln("libxrdp_query_channel - channel item is 0"); return 1; } if (channel_name != 0) { g_strncpy(channel_name, channel_item->name, 8); DEBUG(("libxrdp_query_channel - Channel %d name %s", index, 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) { g_writeln("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) { free_stream(s); return 1; } /* here we make a copy of the data */ out_uint8a(s, data, data_len); s_mark_end(s); if (xrdp_channel_send(chan, s, channel_id, total_data_len, flags) != 0) { g_writeln("libxrdp_send_to_channel: error, server channel data NOT sent to client channel"); 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) { return 1; } channel_item = (struct mcs_channel_item *) list_get_item(mcs->channel_list, channel_id); if (channel_item == NULL) { return 1; } channel_item->disabled = is_disabled; return 1; } /*****************************************************************************/ 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; 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; 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; 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; 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; LLOGLN(10, ("libxrdp_fastpath_send_surface:")); if ((session->client_info->use_fast_path & 1) == 0) { 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) { return 1; } if (sec_bytes + rdp_bytes + cmd_bytes > pad_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->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); /* 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); /* 4 = FASTPATH_UPDATETYPE_SURFCMDS */ if (xrdp_rdp_send_fastpath(rdp, s, 4) != 0) { 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; LLOGLN(10, ("libxrdp_fastpath_send_frame_marker:")); if ((session->client_info->use_fast_path & 1) == 0) { return 1; } if (session->client_info->use_frame_acks == 0) { 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, 0x0004); /* CMDTYPE_FRAME_MARKER */ out_uint16_le(s, frame_action); out_uint32_le(s, frame_id); s_mark_end(s); /* 4 = FASTPATH_UPDATETYPE_SURFCMDS */ if (xrdp_rdp_send_fastpath(rdp, s, 4) != 0) { 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; LLOGLN(10, ("libxrdp_send_session_info:")); rdp = (struct xrdp_rdp *) (session->rdp); return xrdp_rdp_send_session_info(rdp, data, data_bytes); } xrdp-0.9.12/libxrdp/libxrdpinc.h000644 001751 001751 00000024257 13544635323 016475 0ustar00metameta000000 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 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); 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; }; 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); }; struct xrdp_session * libxrdp_init(tbus id, struct trans *trans); 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 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 width, int height, int bpp); 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); int libxrdp_query_channel(struct xrdp_session *session, int index, char *channel_name, int *channel_flags); 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_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); #endif xrdp-0.9.12/libxrdp/xrdp_mcs.c000644 001751 001751 00000064170 13544635323 016147 0ustar00metameta000000 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 */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "log.h" /*****************************************************************************/ 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; DEBUG((" in xrdp_mcs_create")); 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(); DEBUG((" out xrdp_mcs_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. */ DEBUG(("xrdp_mcs_delete processed")) g_memset(self, 0, sizeof(struct xrdp_mcs)) ; g_free(self); } /*****************************************************************************/ /* This function sends channel join confirm */ /* returns error = 1 ok = 0 */ static int xrdp_mcs_send_cjcf(struct xrdp_mcs *self, int userid, int chanid) { struct stream *s; DEBUG((" in xrdp_mcs_send_cjcf")); make_stream(s); init_stream(s, 8192); if (xrdp_iso_init(self->iso_layer, s) != 0) { free_stream(s); DEBUG((" out xrdp_mcs_send_cjcf error")); return 1; } out_uint8(s, (MCS_CJCF << 2) | 2); out_uint8(s, 0); out_uint16_be(s, userid); out_uint16_be(s, chanid); /* TODO Explain why we send this two times */ out_uint16_be(s, chanid); s_mark_end(s); if (xrdp_iso_send(self->iso_layer, s) != 0) { free_stream(s); DEBUG((" out xrdp_mcs_send_cjcf error")); return 1; } free_stream(s); DEBUG((" out xrdp_mcs_send_cjcf")); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan) { int appid; int opcode; int len; int userid; int chanid; DEBUG((" in xrdp_mcs_recv")); while (1) { if (xrdp_iso_recv(self->iso_layer, s) != 0) { DEBUG((" out xrdp_mcs_recv, xrdp_iso_recv return non zero")); g_writeln("xrdp_mcs_recv: xrdp_iso_recv failed"); return 1; } if (!s_check_rem(s, 1)) { return 1; } in_uint8(s, opcode); appid = opcode >> 2; if (appid == MCS_DPUM) /* Disconnect Provider Ultimatum */ { g_writeln("received Disconnect Provider Ultimatum"); DEBUG((" out xrdp_mcs_recv appid != MCS_DPUM")); return 1; } /* this is channels getting added from the client */ if (appid == MCS_CJRQ) { if (!s_check_rem(s, 4)) { return 1; } in_uint16_be(s, userid); in_uint16_be(s, chanid); log_message(LOG_LEVEL_DEBUG,"MCS_CJRQ - channel join request received"); DEBUG(("xrdp_mcs_recv adding channel %4.4x", chanid)); if (xrdp_mcs_send_cjcf(self, userid, chanid) != 0) { log_message(LOG_LEVEL_ERROR,"Non handled error from xrdp_mcs_send_cjcf") ; } s = libxrdp_force_read(self->iso_layer->trans); if (s == 0) { g_writeln("xrdp_mcs_recv: libxrdp_force_read failed"); return 1; } continue; } if (appid == MCS_SDRQ || appid == MCS_SDIN) { break; } else { log_message(LOG_LEVEL_DEBUG,"Received an unhandled appid:%d",appid); } break; } if (appid != MCS_SDRQ) { DEBUG((" out xrdp_mcs_recv err got 0x%x need MCS_SDRQ", appid)); return 1; } if (!s_check_rem(s, 6)) { return 1; } in_uint8s(s, 2); in_uint16_be(s, *chan); in_uint8s(s, 1); in_uint8(s, len); if (len & 0x80) { if (!s_check_rem(s, 1)) { return 1; } in_uint8s(s, 1); } DEBUG((" out xrdp_mcs_recv")); return 0; } /*****************************************************************************/ /* 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(s, 2)) { return 1; } in_uint16_be(s, tag); } else { if (!s_check_rem(s, 1)) { return 1; } in_uint8(s, tag); } if (tag != tag_val) { return 1; } if (!s_check_rem(s, 1)) { return 1; } in_uint8(s, l); if (l & 0x80) { l = l & ~0x80; *len = 0; while (l > 0) { if (!s_check_rem(s, 1)) { return 1; } in_uint8(s, i); *len = (*len << 8) | i; l--; } } else { *len = l; } if (s_check(s)) { return 0; } else { return 1; } } /*****************************************************************************/ /* 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) { return 1; } if ((len < 0) || !s_check_rem(s, len)) { return 1; } in_uint8s(s, len); if (s_check(s)) { return 0; } else { return 1; } } /*****************************************************************************/ /* 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) { return 1; } if (xrdp_iso_recv(self->iso_layer, s) != 0) { return 1; } if (xrdp_mcs_ber_parse_header(self, s, MCS_CONNECT_INITIAL, &len) != 0) { return 1; } if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_OCTET_STRING, &len) != 0) { return 1; } if ((len < 0) || !s_check_rem(s, len)) { return 1; } in_uint8s(s, len); if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_OCTET_STRING, &len) != 0) { return 1; } if ((len < 0) || !s_check_rem(s, len)) { return 1; } in_uint8s(s, len); if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_BOOLEAN, &len) != 0) { return 1; } if ((len < 0) || !s_check_rem(s, len)) { return 1; } in_uint8s(s, len); if (xrdp_mcs_parse_domain_params(self, s) != 0) { return 1; } if (xrdp_mcs_parse_domain_params(self, s) != 0) { return 1; } if (xrdp_mcs_parse_domain_params(self, s) != 0) { return 1; } if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_OCTET_STRING, &len) != 0) { return 1; } /* mcs data can not be zero length */ if ((len <= 0) || (len > 16 * 1024)) { return 1; } if (!s_check_rem(s, len)) { return 1; } /* make a copy of client mcs data */ init_stream(self->client_mcs_data, len); out_uint8a(self->client_mcs_data, s->p, len); in_uint8s(s, len); s_mark_end(self->client_mcs_data); if (s_check_end(s)) { return 0; } else { return 1; } } /*****************************************************************************/ /* returns error */ static int xrdp_mcs_recv_edrq(struct xrdp_mcs *self) { int opcode; struct stream *s; DEBUG((" in xrdp_mcs_recv_edrq")); s = libxrdp_force_read(self->iso_layer->trans); if (s == 0) { return 1; } if (xrdp_iso_recv(self->iso_layer, s) != 0) { return 1; } if (!s_check_rem(s, 1)) { return 1; } in_uint8(s, opcode); if ((opcode >> 2) != MCS_EDRQ) { return 1; } if (!s_check_rem(s, 4)) { return 1; } in_uint8s(s, 2); in_uint8s(s, 2); if (opcode & 2) { if (!s_check_rem(s, 2)) { return 1; } in_uint16_be(s, self->userid); } if (!(s_check_end(s))) { return 1; } DEBUG((" out xrdp_mcs_recv_edrq")); return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_mcs_recv_aurq(struct xrdp_mcs *self) { int opcode; struct stream *s; DEBUG((" in xrdp_mcs_recv_aurq")); s = libxrdp_force_read(self->iso_layer->trans); if (s == 0) { return 1; } if (xrdp_iso_recv(self->iso_layer, s) != 0) { return 1; } if (!s_check_rem(s, 1)) { return 1; } in_uint8(s, opcode); if ((opcode >> 2) != MCS_AURQ) { return 1; } if (opcode & 2) { if (!s_check_rem(s, 2)) { return 1; } in_uint16_be(s, self->userid); } if (!(s_check_end(s))) { return 1; } DEBUG((" out xrdp_mcs_recv_aurq")); return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_mcs_send_aucf(struct xrdp_mcs *self) { struct stream *s; DEBUG((" in xrdp_mcs_send_aucf")); make_stream(s); init_stream(s, 8192); if (xrdp_iso_init(self->iso_layer, s) != 0) { free_stream(s); DEBUG((" out xrdp_mcs_send_aucf error")); return 1; } out_uint8(s, ((MCS_AUCF << 2) | 2)); out_uint8s(s, 1); out_uint16_be(s, self->userid); s_mark_end(s); if (xrdp_iso_send(self->iso_layer, s) != 0) { free_stream(s); DEBUG((" out xrdp_mcs_send_aucf error")); return 1; } free_stream(s); DEBUG((" out xrdp_mcs_send_aucf")); return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_mcs_recv_cjrq(struct xrdp_mcs *self) { int opcode; struct stream *s; s = libxrdp_force_read(self->iso_layer->trans); if (s == 0) { return 1; } if (xrdp_iso_recv(self->iso_layer, s) != 0) { return 1; } if (!s_check_rem(s, 1)) { return 1; } in_uint8(s, opcode); if ((opcode >> 2) != MCS_CJRQ) { return 1; } if (!s_check_rem(s, 4)) { return 1; } in_uint8s(s, 4); if (opcode & 2) { if (!s_check_rem(s, 2)) { return 1; } in_uint8s(s, 2); } if (!(s_check_end(s))) { return 1; } return 0; } /*****************************************************************************/ /* 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); } 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); xrdp_mcs_ber_out_int8(self, s, 0); xrdp_mcs_ber_out_int8(self, s, 1); xrdp_mcs_ber_out_int24(self, s, max_pdu_size); xrdp_mcs_ber_out_int8(self, s, 2); return 0; } /*****************************************************************************/ /* prepare server gcc data to send in mcs response msg */ 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; 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); out_uint16_be(s, 5); /* AsnBerObjectIdentifier */ out_uint16_be(s, 0x14); out_uint8(s, 0x7c); out_uint16_be(s, 1); /* -- */ out_uint8(s, 0x2a); /* ConnectPDULen */ out_uint8(s, 0x14); out_uint8(s, 0x76); out_uint8(s, 0x0a); out_uint8(s, 1); out_uint8(s, 1); out_uint8(s, 0); out_uint16_le(s, 0xc001); out_uint8(s, 0); out_uint8(s, 0x4d); /* M */ out_uint8(s, 0x63); /* c */ out_uint8(s, 0x44); /* D */ out_uint8(s, 0x6e); /* n */ /* GCC Response Total Length - 2 bytes , set later */ gcc_size_ptr = s->p; /* RDPGCCUserDataResponseLength */ out_uint8s(s, 2); ud_ptr = s->p; /* User Data */ out_uint16_le(s, SEC_TAG_SRV_INFO); if (self->mcs_layer->iso_layer->rdpNegData) { out_uint16_le(s, 12); /* len */ } else { out_uint16_le(s, 8); /* len */ } out_uint8(s, 4); /* 4 = rdp5 1 = rdp4 */ out_uint8(s, 0); out_uint8(s, 8); out_uint8(s, 0); if (self->mcs_layer->iso_layer->rdpNegData) { /* RequestedProtocol */ out_uint32_le(s, self->mcs_layer->iso_layer->requestedProtocol); } out_uint16_le(s, SEC_TAG_SRV_CHANNELS); out_uint16_le(s, 8 + (num_channels_even * 2)); /* len */ out_uint16_le(s, MCS_GLOBAL_CHANNEL); /* 1003, 0x03eb main channel */ out_uint16_le(s, num_channels); /* number of other channels */ for (index = 0; index < num_channels_even; index++) { if (index < num_channels) { channel = MCS_GLOBAL_CHANNEL + (index + 1); out_uint16_le(s, channel); } else { out_uint16_le(s, 0); } } if (self->rsa_key_bytes == 64) { g_writeln("xrdp_sec_out_mcs_data: using 512 bit RSA key"); out_uint16_le(s, SEC_TAG_SRV_CRYPT); out_uint16_le(s, 0x00ec); /* len is 236 */ out_uint32_le(s, self->crypt_method); out_uint32_le(s, self->crypt_level); out_uint32_le(s, 32); /* 32 bytes random len */ out_uint32_le(s, 0xb8); /* 184 bytes rsa info(certificate) len */ out_uint8a(s, self->server_random, 32); /* here to end is certificate */ /* HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ */ /* TermService\Parameters\Certificate */ out_uint32_le(s, 1); out_uint32_le(s, 1); out_uint32_le(s, 1); out_uint16_le(s, SEC_TAG_PUBKEY); /* 0x0006 */ out_uint16_le(s, 0x005c); /* 92 bytes length of SEC_TAG_PUBKEY */ out_uint32_le(s, SEC_RSA_MAGIC); /* 0x31415352 'RSA1' */ out_uint32_le(s, 0x0048); /* 72 bytes modulus len */ out_uint32_be(s, 0x00020000); /* bit len */ out_uint32_be(s, 0x3f000000); /* data len */ out_uint8a(s, self->pub_exp, 4); /* pub exp */ out_uint8a(s, self->pub_mod, 64); /* pub mod */ out_uint8s(s, 8); /* pad */ out_uint16_le(s, SEC_TAG_KEYSIG); /* 0x0008 */ out_uint16_le(s, 72); /* len */ out_uint8a(s, self->pub_sig, 64); /* pub sig */ out_uint8s(s, 8); /* pad */ } else if (self->rsa_key_bytes == 256) { g_writeln("xrdp_sec_out_mcs_data: using 2048 bit RSA key"); out_uint16_le(s, SEC_TAG_SRV_CRYPT); out_uint16_le(s, 0x01ac); /* len is 428 */ out_uint32_le(s, self->crypt_method); out_uint32_le(s, self->crypt_level); out_uint32_le(s, 32); /* 32 bytes random len */ out_uint32_le(s, 0x178); /* 376 bytes rsa info(certificate) len */ out_uint8a(s, self->server_random, 32); /* here to end is certificate */ /* HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ */ /* TermService\Parameters\Certificate */ out_uint32_le(s, 1); out_uint32_le(s, 1); out_uint32_le(s, 1); out_uint16_le(s, SEC_TAG_PUBKEY); /* 0x0006 */ out_uint16_le(s, 0x011c); /* 284 bytes length of SEC_TAG_PUBKEY */ out_uint32_le(s, SEC_RSA_MAGIC); /* 0x31415352 'RSA1' */ out_uint32_le(s, 0x0108); /* 264 bytes modulus len */ out_uint32_be(s, 0x00080000); /* bit len */ out_uint32_be(s, 0xff000000); /* data len */ out_uint8a(s, self->pub_exp, 4); /* pub exp */ out_uint8a(s, self->pub_mod, 256); /* pub mod */ out_uint8s(s, 8); /* pad */ out_uint16_le(s, SEC_TAG_KEYSIG); /* 0x0008 */ out_uint16_le(s, 72); /* len */ out_uint8a(s, self->pub_sig, 64); /* pub sig */ out_uint8s(s, 8); /* pad */ } else if (self->rsa_key_bytes == 0) /* no security */ { g_writeln("xrdp_sec_out_mcs_data: using no security"); out_uint16_le(s, SEC_TAG_SRV_CRYPT); out_uint16_le(s, 12); /* len is 12 */ out_uint32_le(s, self->crypt_method); out_uint32_le(s, self->crypt_level); } else { g_writeln("xrdp_sec_out_mcs_data: error"); } /* end certificate */ 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; } /*****************************************************************************/ /* returns error */ static int xrdp_mcs_send_connect_response(struct xrdp_mcs *self) { int data_len; struct stream *s; DEBUG((" in xrdp_mcs_send_connect_response")); 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); xrdp_mcs_ber_out_header(self, s, BER_TAG_INTEGER, 1); out_uint8(s, 0); 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); if (xrdp_iso_send(self->iso_layer, s) != 0) { free_stream(s); DEBUG((" out xrdp_mcs_send_connect_response error")); return 1; } free_stream(s); DEBUG((" out xrdp_mcs_send_connect_response")); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_mcs_incoming(struct xrdp_mcs *self) { int index; DEBUG((" in xrdp_mcs_incoming")); if (xrdp_mcs_recv_connect_initial(self) != 0) { return 1; } /* in xrdp_sec.c */ if (xrdp_sec_process_mcs_data(self->sec_layer) != 0) { return 1; } if (xrdp_mcs_out_gcc_data(self->sec_layer) != 0) { return 1; } if (xrdp_mcs_send_connect_response(self) != 0) { return 1; } if (xrdp_mcs_recv_edrq(self) != 0) { return 1; } if (xrdp_mcs_recv_aurq(self) != 0) { return 1; } if (xrdp_mcs_send_aucf(self) != 0) { return 1; } for (index = 0; index < self->channel_list->count + 2; index++) { if (xrdp_mcs_recv_cjrq(self) != 0) { return 1; } if (xrdp_mcs_send_cjcf(self, self->userid, self->userid + MCS_USERCHANNEL_BASE + index) != 0) { return 1; } } DEBUG((" out xrdp_mcs_incoming")); 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) { /* in xrdp_wm.c */ rv = session->callback(session->id, 0x5556, 0, 0, 0, 0); } else { g_writeln("in xrdp_mcs_send, session->callback is nil"); } } else { g_writeln("in xrdp_mcs_send, session is nil"); } return rv; } /*****************************************************************************/ /* returns error */ int xrdp_mcs_send(struct xrdp_mcs *self, struct stream *s, int chan) { int len; char *lp; //static int max_len = 0; DEBUG((" in xrdp_mcs_send")); s_pop_layer(s, mcs_hdr); len = (s->end - s->p) - 8; if (len > 8192 * 2) { g_writeln("error in xrdp_mcs_send, size too big: %d bytes", len); } //if (len > max_len) //{ // max_len = len; // g_printf("mcs max length is %d\r\n", max_len); //} //g_printf("mcs length %d max length is %d\r\n", len, max_len); //g_printf("mcs length %d\r\n", len); out_uint8(s, MCS_SDIN << 2); out_uint16_be(s, self->userid); out_uint16_be(s, chan); out_uint8(s, 0x70); if (len >= 128) { len = len | 0x8000; out_uint16_be(s, len); } else { out_uint8(s, len); /* move everything up one byte */ lp = s->p; while (lp < s->end) { lp[0] = lp[1]; lp++; } s->end--; } if (xrdp_iso_send(self->iso_layer, s) != 0) { DEBUG((" out xrdp_mcs_send error")); 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); } DEBUG((" out xrdp_mcs_send")); 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 = 0 ; g_writeln("xrdp_mcs_disconnect - socket closed"); return; } } g_writeln("Failed to close socket"); } /*****************************************************************************/ /* returns error */ int xrdp_mcs_disconnect(struct xrdp_mcs *self) { struct stream *s; DEBUG((" in xrdp_mcs_disconnect")); make_stream(s); init_stream(s, 8192); if (xrdp_iso_init(self->iso_layer, s) != 0) { free_stream(s); close_rdp_socket(self); DEBUG((" out xrdp_mcs_disconnect error - 1")); return 1; } out_uint8(s, (MCS_DPUM << 2) | 1); out_uint8(s, 0x80); s_mark_end(s); if (xrdp_iso_send(self->iso_layer, s) != 0) { free_stream(s); close_rdp_socket(self); DEBUG((" out xrdp_mcs_disconnect error - 2")); return 1; } free_stream(s); close_rdp_socket(self); DEBUG(("xrdp_mcs_disconnect - close sent")); return 0; } xrdp-0.9.12/libxrdp/Makefile.in000644 001751 001751 00000062320 13601646126 016221 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG @XRDP_NEUTRINORDP_TRUE@am__append_2 = -DXRDP_NEUTRINORDP @XRDP_NEUTRINORDP_TRUE@am__append_3 = $(FREERDP_LIBS) @XRDP_RFXCODEC_TRUE@am__append_4 = -DXRDP_RFXCODEC @XRDP_TJPEG_TRUE@am__append_5 = -DXRDP_JPEG -DXRDP_TJPEG @TurboJpegIncDir@ @XRDP_TJPEG_TRUE@am__append_6 = @TurboJpegLibDir@ @XRDP_TJPEG_TRUE@am__append_7 = -lturbojpeg @XRDP_JPEG_TRUE@@XRDP_TJPEG_FALSE@am__append_8 = -DXRDP_JPEG @XRDP_JPEG_TRUE@@XRDP_TJPEG_FALSE@am__append_9 = -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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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_2) \ $(am__append_4) $(am__append_5) $(am__append_8) AM_CFLAGS = $(OPENSSL_CFLAGS) AM_LDFLAGS = $(am__append_6) LIBXRDP_EXTRA_LIBS = $(am__append_3) $(am__append_7) $(am__append_9) 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_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: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/libxrdp/xrdp_orders_rail.h000644 001751 001751 00000003731 13544635323 017673 0ustar00metameta000000 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 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.9.12/libxrdp/xrdp_bitmap_compress.c000644 001751 001751 00000144066 13544635323 020557 0ustar00metameta000000 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.9.12/libxrdp/xrdp_caps.c000644 001751 001751 00000106674 13544635323 016321 0ustar00metameta000000 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 "libxrdp.h" /*****************************************************************************/ static int xrdp_caps_send_monitorlayout(struct xrdp_rdp *self) { struct stream *s; int i; make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data(self, s) != 0) { free_stream(s); return 1; } out_uint32_le(s, self->client_info.monitorCount); /* monitorCount (4 bytes) */ /* TODO: validate for allowed monitors in terminal server (maybe by config?) */ for (i = 0; i < self->client_info.monitorCount; i++) { out_uint32_le(s, self->client_info.minfo[i].left); out_uint32_le(s, self->client_info.minfo[i].top); out_uint32_le(s, self->client_info.minfo[i].right); out_uint32_le(s, self->client_info.minfo[i].bottom); out_uint32_le(s, self->client_info.minfo[i].is_primary); } s_mark_end(s); if (xrdp_rdp_send_data(self, s, 0x37) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ 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) { g_writeln("xrdp_caps_process_general: error"); 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_order(struct xrdp_rdp *self, struct stream *s, int len) { int i; char order_caps[32]; int ex_flags; int cap_flags; DEBUG(("order capabilities")); if (len < 20 + 2 + 2 + 2 + 2 + 2 + 2 + 32 + 2 + 2 + 4 + 4 + 4 + 4) { g_writeln("xrdp_caps_process_order: error"); 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); DEBUG(("dest blt-0 %d", order_caps[0])); DEBUG(("pat blt-1 %d", order_caps[1])); DEBUG(("screen blt-2 %d", order_caps[2])); DEBUG(("memblt-3-13 %d %d", order_caps[3], order_caps[13])); DEBUG(("triblt-4-14 %d %d", order_caps[4], order_caps[14])); DEBUG(("line-8 %d", order_caps[8])); DEBUG(("line-9 %d", order_caps[9])); DEBUG(("rect-10 %d", order_caps[10])); DEBUG(("desksave-11 %d", order_caps[11])); DEBUG(("polygon-20 %d", order_caps[20])); DEBUG(("polygon2-21 %d", order_caps[21])); DEBUG(("polyline-22 %d", order_caps[22])); DEBUG(("ellipse-25 %d", order_caps[25])); DEBUG(("ellipse2-26 %d", order_caps[26])); DEBUG(("text2-27 %d", order_caps[27])); DEBUG(("order_caps dump")); #if defined(XRDP_DEBUG) g_hexdump(order_caps, 32); #endif in_uint8s(s, 2); /* Text capability flags */ /* read extended order support flags */ in_uint16_le(s, ex_flags); /* 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) { g_writeln("xrdp_caps_process_order: 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; DEBUG(("desktop cache size %d", i)); in_uint8s(s, 4); /* Unknown */ in_uint8s(s, 4); /* Unknown */ /* 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])) { g_writeln("xrdp_caps_process_order: 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) { g_writeln("xrdp_caps_process_bmpcache: error"); 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); DEBUG(("cache1 entries %d size %d", self->client_info.cache1_entries, self->client_info.cache1_size)); DEBUG(("cache2 entries %d size %d", self->client_info.cache2_entries, self->client_info.cache2_size)); DEBUG(("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) { g_writeln("xrdp_caps_process_bmpcache2: error"); 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; DEBUG(("cache1 entries %d size %d", self->client_info.cache1_entries, self->client_info.cache1_size)); DEBUG(("cache2 entries %d size %d", self->client_info.cache2_entries, self->client_info.cache2_size)); DEBUG(("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) { g_writeln("xrdp_caps_process_cache_v3_codec_id: error"); return 1; } in_uint8(s, codec_id); g_writeln("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) { g_writeln("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) { g_writeln("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 { g_writeln("xrdp_caps_process_pointer: client does not support " "new(color) cursor"); } if (no_new_cursor) { g_writeln("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) { g_writeln("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 */ { g_writeln("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; } g_writeln("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) { g_writeln("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; g_writeln("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) { g_writeln("xrdp_caps_process_rail: error"); return 1; } in_uint32_le(s, i32); self->client_info.rail_support_level = i32; g_writeln("xrdp_process_capset_rail: rail_support_level %d", self->client_info.rail_support_level); return 0; } /*****************************************************************************/ static int xrdp_caps_process_window(struct xrdp_rdp *self, struct stream *s, int len) { int i32; if (len < 4 + 1 + 2) { g_writeln("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; g_writeln("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; if (len < 1) { g_writeln("xrdp_caps_process_codecs: error"); return 1; } in_uint8(s, codec_count); len--; for (index = 0; index < codec_count; index++) { codec_guid = s->p; if (len < 16 + 1 + 2) { g_writeln("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) { g_writeln("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) { g_writeln("xrdp_caps_process_codecs: nscodec, codec id %d, properties len %d", 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) { g_writeln("xrdp_caps_process_codecs: RemoteFX, codec id %d, properties len %d", 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) { g_writeln("xrdp_caps_process_codecs: jpeg, codec id %d, properties len %d", 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) { g_writeln(" 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 */ } g_writeln(" jpeg quality set to %d", self->client_info.jpeg_prop[0]); } else if (g_memcmp(codec_guid, XR_CODEC_GUID_H264, 16) == 0) { g_writeln("xrdp_caps_process_codecs: h264, codec id %d, properties len %d", 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; } else { g_writeln("xrdp_caps_process_codecs: unknown codec id %d", codec_id); } 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); self->client_info.max_fastpath_frag_bytes = MaxRequestSize; return 0; } /*****************************************************************************/ static int xrdp_caps_process_frame_ack(struct xrdp_rdp *self, struct stream *s, int len) { g_writeln("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) { g_writeln(" 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; } g_writeln(" 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; g_writeln("xrdp_caps_process_surface_cmds:"); in_uint32_le(s, cmdFlags); in_uint8s(s, 4); /* reserved */ g_writeln(" cmdFlags 0x%08x", cmdFlags); return 0; } /*****************************************************************************/ 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; DEBUG(("in xrdp_caps_process_confirm_active")); 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); in_uint8s(s, source_len); in_uint16_le(s, num_caps); in_uint8s(s, 2); /* pad */ if ((cap_len < 0) || (cap_len > 1024 * 1024)) { return 1; } for (index = 0; index < num_caps; index++) { p = s->p; if (!s_check_rem(s, 4)) { g_writeln("xrdp_caps_process_confirm_active: error 1"); return 1; } in_uint16_le(s, type); in_uint16_le(s, len); if ((len < 4) || !s_check_rem(s, len - 4)) { g_writeln("xrdp_caps_process_confirm_active: error: len %d, " "remaining %d", len, (int) (s->end - s->p)); return 1; } len -= 4; switch (type) { case CAPSTYPE_GENERAL: DEBUG(("CAPSTYPE_GENERAL")); xrdp_caps_process_general(self, s, len); break; case CAPSTYPE_BITMAP: DEBUG(("CAPSTYPE_BITMAP")); break; case CAPSTYPE_ORDER: DEBUG(("CAPSTYPE_ORDER")); xrdp_caps_process_order(self, s, len); break; case CAPSTYPE_BITMAPCACHE: DEBUG(("CAPSTYPE_BMPCACHE")); xrdp_caps_process_bmpcache(self, s, len); break; case CAPSTYPE_CONTROL: DEBUG(("CAPSTYPE_CONTROL")); break; case 6: xrdp_caps_process_cache_v3_codec_id(self, s, len); break; case CAPSTYPE_ACTIVATION: DEBUG(("CAPSTYPE_ACTIVAION")); break; case CAPSTYPE_POINTER: DEBUG(("CAPSTYPE_POINTER")); xrdp_caps_process_pointer(self, s, len); break; case CAPSTYPE_SHARE: DEBUG(("CAPSTYPE_SHARE")); break; case CAPSTYPE_COLORCACHE: DEBUG(("CAPSTYPE_COLORCACHE")); break; case CAPSTYPE_SOUND: DEBUG(("CAPSTYPE_SOUND")); break; case CAPSTYPE_INPUT: xrdp_caps_process_input(self, s, len); break; case CAPSTYPE_FONT: DEBUG(("CAPSTYPE_FONT")); break; case CAPSTYPE_BRUSH: xrdp_caps_process_brushcache(self, s, len); break; case CAPSTYPE_GLYPHCACHE: DEBUG(("CAPSTYPE_GLYPHCACHE")); xrdp_caps_process_glyphcache(self, s, len); break; case CAPSTYPE_OFFSCREENCACHE: DEBUG(("CAPSTYPE_OFFSCREENCACHE")); xrdp_caps_process_offscreen_bmpcache(self, s, len); break; case CAPSTYPE_BITMAPCACHE_REV2: DEBUG(("CAPSTYPE_BITMAPCACHE_REV2")); xrdp_caps_process_bmpcache2(self, s, len); break; case CAPSTYPE_VIRTUALCHANNEL: DEBUG(("CAPSTYPE_VIRTUALCHANNEL")); break; case CAPSTYPE_DRAWNINGRIDCACHE: DEBUG(("CAPSTYPE_DRAWNINGRIDCACHE")); break; case CAPSTYPE_DRAWGDIPLUS: DEBUG(("CAPSTYPE_DRAWGDIPLUS")); break; case CAPSTYPE_RAIL: xrdp_caps_process_rail(self, s, len); break; case CAPSTYPE_WINDOW: xrdp_caps_process_window(self, s, len); break; case CAPSSETTYPE_MULTIFRAGMENTUPDATE: xrdp_caps_process_multifragmentupdate(self, s, len); break; case CAPSETTYPE_SURFACE_COMMANDS: xrdp_caps_process_surface_cmds(self, s, len); break; case CAPSSETTYPE_BITMAP_CODECS: xrdp_caps_process_codecs(self, s, len); break; case CAPSTYPE_FRAME_ACKNOWLEDGE: xrdp_caps_process_frame_ack(self, s, len); break; default: g_writeln("unknown in xrdp_caps_process_confirm_active %d", type); break; } s->p = p + len + 4; } if (self->client_info.no_orders_supported && (self->client_info.offscreen_support_level != 0)) { g_writeln("xrdp_caps_process_confirm_active: 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; } DEBUG(("out xrdp_caps_process_confirm_active")); return 0; } /*****************************************************************************/ 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); DEBUG(("in xrdp_caps_send_demand_active")); if (xrdp_rdp_init(self, s) != 0) { 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 */ /* 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 */ /* 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.width); /* width */ out_uint16_le(s, self->client_info.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 */ /* Output font capability set */ caps_count++; out_uint16_le(s, CAPSTYPE_FONT); out_uint16_le(s, CAPSTYPE_FONT_LEN); /* 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); /* ? */ /* 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 */ #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 */ /* 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 */ #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 */ /* 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 */ /* 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 */ /* Output input capability set */ 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); 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 */ /* 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 */ } /* 6 - bitmap cache v3 codecid */ caps_count++; out_uint16_le(s, 0x0006); out_uint16_le(s, 5); out_uint8(s, 0); /* client sets */ if (self->client_info.use_fast_path & FASTPATH_OUTPUT_SUPPORTED) /* fastpath output on */ { /* multifragment update */ caps_count++; out_uint16_le(s, CAPSSETTYPE_MULTIFRAGMENTUPDATE); out_uint16_le(s, CAPSSETTYPE_MULTIFRAGMENTUPDATE_LEN); out_uint32_le(s, 3 * 1024 * 1024); /* 3MB */ /* 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 */ /* 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 */ } 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; if (xrdp_rdp_send(self, s, PDUTYPE_DEMANDACTIVEPDU) != 0) { free_stream(s); return 1; } DEBUG(("out (1) xrdp_caps_send_demand_active")); /* send Monitor Layout PDU for dual monitor */ if (self->client_info.monitorCount > 0 && self->client_info.multimon == 1) { DEBUG(("xrdp_caps_send_demand_active: sending monitor layout pdu")); if (xrdp_caps_send_monitorlayout(self) != 0) { g_writeln("xrdp_caps_send_demand_active: error sending monitor layout pdu"); } } free_stream(s); return 0; } xrdp-0.9.12/libxrdp/xrdp_mppc_enc.c000644 001751 001751 00000072657 13544635323 017162 0ustar00metameta000000 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" #define MPPC_ENC_DEBUG 0 #if MPPC_ENC_DEBUG #define DLOG(_args) g_printf _args #else #define DLOG(_args) do { } while (0) #endif /* 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); DLOG(("%.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; DLOG(("%.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; DLOG(("<%d: %ld,%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]; DLOG(("%.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 */ 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; DLOG(("\n")); //g_writeln("compression ratio: %f", (float) len / (float) enc->bytes_in_opb); 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.9.12/libxrdp/xrdp_sec.c000644 001751 001751 00000222166 13544635323 016140 0ustar00metameta000000 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 "log.h" #define LOG_LEVEL 1 #define LLOG(_level, _args) \ do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0) #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { g_writeln _args ; } } while (0) #define LHEXDUMP(_level, _args) \ do { if (_level < LOG_LEVEL) { g_hexdump _args ; } } while (0) /* 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 }; /* some compilers need unsigned char to avoid warnings */ static tui8 g_lic1[322] = { 0x80, 0x00, 0x3e, 0x01, 0x01, 0x02, 0x3e, 0x01, 0x7b, 0x3c, 0x31, 0xa6, 0xae, 0xe8, 0x74, 0xf6, 0xb4, 0xa5, 0x03, 0x90, 0xe7, 0xc2, 0xc7, 0x39, 0xba, 0x53, 0x1c, 0x30, 0x54, 0x6e, 0x90, 0x05, 0xd0, 0x05, 0xce, 0x44, 0x18, 0x91, 0x83, 0x81, 0x00, 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x69, 0x00, 0x63, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x6f, 0x00, 0x66, 0x00, 0x74, 0x00, 0x20, 0x00, 0x43, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x33, 0x00, 0x36, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0xb8, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 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, 0x01, 0xc7, 0xc9, 0xf7, 0x8e, 0x5a, 0x38, 0xe4, 0x29, 0xc3, 0x00, 0x95, 0x2d, 0xdd, 0x4c, 0x3e, 0x50, 0x45, 0x0b, 0x0d, 0x9e, 0x2a, 0x5d, 0x18, 0x63, 0x64, 0xc4, 0x2c, 0xf7, 0x8f, 0x29, 0xd5, 0x3f, 0xc5, 0x35, 0x22, 0x34, 0xff, 0xad, 0x3a, 0xe6, 0xe3, 0x95, 0x06, 0xae, 0x55, 0x82, 0xe3, 0xc8, 0xc7, 0xb4, 0xa8, 0x47, 0xc8, 0x50, 0x71, 0x74, 0x29, 0x53, 0x89, 0x6d, 0x9c, 0xed, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x48, 0x00, 0xa8, 0xf4, 0x31, 0xb9, 0xab, 0x4b, 0xe6, 0xb4, 0xf4, 0x39, 0x89, 0xd6, 0xb1, 0xda, 0xf6, 0x1e, 0xec, 0xb1, 0xf0, 0x54, 0x3b, 0x5e, 0x3e, 0x6a, 0x71, 0xb4, 0xf7, 0x75, 0xc8, 0x16, 0x2f, 0x24, 0x00, 0xde, 0xe9, 0x82, 0x99, 0x5f, 0x33, 0x0b, 0xa9, 0xa6, 0x94, 0xaf, 0xcb, 0x11, 0xc3, 0xf2, 0xdb, 0x09, 0x42, 0x68, 0x29, 0x56, 0x58, 0x01, 0x56, 0xdb, 0x59, 0x03, 0x69, 0xdb, 0x7d, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x00 }; /* some compilers need unsigned char to avoid warnings */ static tui8 g_lic2[20] = { 0x80, 0x00, 0x10, 0x00, 0xff, 0x02, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x28, 0x14, 0x00, 0x00 }; /* mce */ /* some compilers need unsigned char to avoid warnings */ static tui8 g_lic3[20] = { 0x80, 0x02, 0x10, 0x00, 0xff, 0x03, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf3, 0x99, 0x00, 0x00 }; 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 }; LLOGLN(0, ("xrdp_load_keyboard_layout: keyboard_type [%d] keyboard_subtype [%d]", client_info->keyboard_type, client_info->keyboard_subtype)); /* 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); LLOGLN(10, ("keyboard_cfg_file %s", keyboard_cfg_file)); fd = g_file_open(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); LLOGLN(10, ("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. */ LLOGLN(10, ("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); LLOGLN(0, ("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 { LLOGLN(0, ("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; DEBUG((" in xrdp_sec_create")); 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; DEBUG((" out xrdp_sec_create")); return self; } /*****************************************************************************/ void xrdp_sec_delete(struct xrdp_sec *self) { if (self == 0) { g_writeln("xrdp_sec_delete: self is null"); 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) { 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); } } 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) { LLOGLN(10, ("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) { LLOGLN(10, ("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) { LLOGLN(10, ("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) { LLOGLN(10, ("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++; } /***************************************************************************** * convert utf-16 encoded string from stream into utf-8 string. * note: src_bytes doesn't include the null-terminator char. */ static int unicode_utf16_in(struct stream *s, int src_bytes, char *dst, int dst_len) { twchar *src; int num_chars; int i; int bytes; LLOGLN(10, ("unicode_utf16_in: uni_len %d, dst_len %d", src_bytes, dst_len)); if (src_bytes == 0) { if (!s_check_rem(s, 2)) { return 1; } in_uint8s(s, 2); /* null terminator */ return 0; } bytes = src_bytes + 2; /* include the null terminator */ src = g_new0(twchar, bytes); for (i = 0; i < bytes / 2; ++i) { if (!s_check_rem(s, 2)) { g_free(src); return 1; } in_uint16_le(s, src[i]); } num_chars = g_wcstombs(dst, src, dst_len); if (num_chars < 0) { g_memset(dst, '\0', dst_len); } LLOGLN(10, ("unicode_utf16_in: num_chars %d, dst %s", num_chars, dst)); g_free(src); return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s) { int flags = 0; int len_domain = 0; int len_user = 0; int len_password = 0; int len_program = 0; int len_directory = 0; int len_ip = 0; int len_dll = 0; char tmpdata[256]; /* initialize (zero out) local variables */ g_memset(tmpdata, 0, sizeof(char) * 256); if (!s_check_rem(s, 8)) { return 1; } in_uint8s(s, 4); in_uint32_le(s, flags); DEBUG(("in xrdp_sec_process_logon_info flags $%x", flags)); /* this is the first test that the decrypt is working */ if ((flags & RDP_LOGON_NORMAL) != RDP_LOGON_NORMAL) /* 0x33 */ { /* must be or error */ DEBUG(("xrdp_sec_process_logon_info: flags wrong, major error")); LLOGLN(0, ("xrdp_sec_process_logon_info: flags wrong, likely decrypt " "not working")); return 1; } if (flags & RDP_LOGON_LEAVE_AUDIO) { self->rdp_layer->client_info.sound_code = 1; DEBUG(("flag RDP_LOGON_LEAVE_AUDIO found")); } if (flags & RDP_LOGON_RAIL) { self->rdp_layer->client_info.rail_enable = 1; DEBUG(("flag RDP_LOGON_RAIL found")); } if ((flags & RDP_LOGON_AUTO) && (!self->rdp_layer->client_info.is_mce)) /* todo, for now not allowing autologon and mce both */ { self->rdp_layer->client_info.rdp_autologin = 1; DEBUG(("flag RDP_LOGON_AUTO found")); } if (flags & RDP_COMPRESSION) { DEBUG(("flag RDP_COMPRESSION found")); if (self->rdp_layer->client_info.use_bulk_comp) { DEBUG(("flag RDP_COMPRESSION set")); self->rdp_layer->client_info.rdp_compression = 1; } else { DEBUG(("flag RDP_COMPRESSION not set")); } } if (!s_check_rem(s, 2)) { return 1; } in_uint16_le(s, len_domain); if (len_domain > 511) { DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_domain > 511")); return 1; } if (!s_check_rem(s, 2)) { 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 = 0; } if (len_user > 511) { DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_user > 511")); return 1; } if (!s_check_rem(s, 2)) { return 1; } in_uint16_le(s, len_password); if (len_password > 511) { DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_password > 511")); return 1; } if (!s_check_rem(s, 2)) { return 1; } in_uint16_le(s, len_program); if (len_program > 511) { DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_program > 511")); return 1; } if (!s_check_rem(s, 2)) { return 1; } in_uint16_le(s, len_directory); if (len_directory > 511) { DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_directory > 511")); return 1; } if (unicode_utf16_in(s, len_domain, self->rdp_layer->client_info.domain, sizeof(self->rdp_layer->client_info.domain) - 1) != 0) { return 1; } DEBUG(("domain %s", self->rdp_layer->client_info.domain)); if (unicode_utf16_in(s, len_user, self->rdp_layer->client_info.username, sizeof(self->rdp_layer->client_info.username) - 1) != 0) { return 1; } DEBUG(("username %s", self->rdp_layer->client_info.username)); if (flags & RDP_LOGON_AUTO) { if (unicode_utf16_in(s, len_password, self->rdp_layer->client_info.password, sizeof(self->rdp_layer->client_info.password) - 1) != 0) { return 1; } DEBUG(("flag RDP_LOGON_AUTO found")); } else { if (!s_check_rem(s, len_password + 2)) { return 1; } in_uint8s(s, len_password + 2); if (self->rdp_layer->client_info.require_credentials) { g_writeln("xrdp_sec_process_logon_info: credentials on cmd line is mandatory"); return 1; /* credentials on cmd line is mandatory */ } } if (unicode_utf16_in(s, len_program, self->rdp_layer->client_info.program, sizeof(self->rdp_layer->client_info.program) - 1) != 0) { return 1; } DEBUG(("program %s", self->rdp_layer->client_info.program)); if (unicode_utf16_in(s, len_directory, self->rdp_layer->client_info.directory, sizeof(self->rdp_layer->client_info.directory) - 1) != 0) { return 1; } DEBUG(("directory %s", self->rdp_layer->client_info.directory)); if (flags & RDP_LOGON_BLOB) { if (!s_check_rem(s, 4)) { return 1; } in_uint8s(s, 2); /* unknown */ in_uint16_le(s, len_ip); if (unicode_utf16_in(s, len_ip - 2, tmpdata, sizeof(tmpdata) - 1) != 0) { return 1; } if (!s_check_rem(s, 2)) { return 1; } in_uint16_le(s, len_dll); if (unicode_utf16_in(s, len_dll - 2, tmpdata, sizeof(tmpdata) - 1) != 0) { return 1; } if (!s_check_rem(s, 4 + 62 + 22 + 62 + 26 + 4)) { return 1; } in_uint8s(s, 4); /* len of timezone */ in_uint8s(s, 62); /* skip */ in_uint8s(s, 22); /* skip misc. */ in_uint8s(s, 62); /* skip */ in_uint8s(s, 26); /* skip stuff */ in_uint32_le(s, self->rdp_layer->client_info.rdp5_performanceflags); } DEBUG(("out xrdp_sec_process_logon_info")); return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_sec_send_lic_initial(struct xrdp_sec *self) { struct stream *s; LLOGLN(10, ("xrdp_sec_send_lic_initial:")); make_stream(s); init_stream(s, 8192); if (xrdp_mcs_init(self->mcs_layer, s) != 0) { free_stream(s); return 1; } out_uint8a(s, g_lic1, 322); s_mark_end(s); if (xrdp_mcs_send(self->mcs_layer, s, MCS_GLOBAL_CHANNEL) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /* 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) { free_stream(s); return 1; } out_uint8a(s, g_lic2, 20); s_mark_end(s); if (xrdp_mcs_send(self->mcs_layer, s, MCS_GLOBAL_CHANNEL) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_sec_send_media_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) { free_stream(s); return 1; } out_uint8a(s, g_lic3, sizeof(g_lic3)); s_mark_end(s); if (xrdp_mcs_send(self->mcs_layer, s, MCS_GLOBAL_CHANNEL) != 0) { 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; LLOGLN(0, ("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]; LLOGLN(0, ("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; LLOGLN(10, ("xrdp_sec_recv_fastpath:")); if (xrdp_fastpath_recv(self->fastpath_layer, s) != 0) { return 1; } if (self->fastpath_layer->secFlags & FASTPATH_INPUT_ENCRYPTED) { if (self->crypt_level == CRYPT_LEVEL_FIPS) { if (!s_check_rem(s, 12)) { return 1; } in_uint16_le(s, len); in_uint8(s, ver); /* length (2 bytes) */ if (len != 0x10) /* length MUST set to 0x10 */ { return 1; } in_uint8(s, pad); LLOGLN(10, ("xrdp_sec_recv_fastpath: len %d ver %d pad %d", len, ver, pad)); in_uint8s(s, 8); /* dataSignature (8 bytes), skip for now */ LLOGLN(10, ("xrdp_sec_recv_fastpath: 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(s, 8)) { return 1; } 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) { /** * If numberEvents is not provided in fpInputHeader, it will be provided * as one additional byte here. */ if (!s_check_rem(s, 8)) { return 1; } in_uint8(s, self->fastpath_layer->numEvents); /* numEvents (1 byte) (optional) */ } 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; DEBUG((" in xrdp_sec_recv")); if (xrdp_mcs_recv(self->mcs_layer, s, chan) != 0) { DEBUG((" out xrdp_sec_recv : error")); g_writeln("xrdp_sec_recv: xrdp_mcs_recv failed"); return 1; } if (!s_check_rem(s, 4)) { return 1; } if (!(self->is_security_header_present)) { return 0; } in_uint32_le(s, flags); DEBUG((" in xrdp_sec_recv flags $%x", flags)); if (flags & SEC_ENCRYPT) /* 0x08 */ { if (self->crypt_level == CRYPT_LEVEL_FIPS) { if (!s_check_rem(s, 12)) { return 1; } in_uint16_le(s, len); in_uint8(s, ver); if ((len != 16) || (ver != 1)) { return 1; } in_uint8(s, pad); LLOGLN(10, ("xrdp_sec_recv: len %d ver %d pad %d", len, ver, pad)); in_uint8s(s, 8); /* signature(8) */ LLOGLN(10, ("xrdp_sec_recv: 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 (self->crypt_level > CRYPT_LEVEL_NONE) { if (!s_check_rem(s, 8)) { return 1; } in_uint8s(s, 8); /* signature(8) */ xrdp_sec_decrypt(self, s->p, (int)(s->end - s->p)); } } if (flags & SEC_CLIENT_RANDOM) /* 0x01 */ { if (!s_check_rem(s, 4)) { return 1; } in_uint32_le(s, len); /* 512, 2048 bit */ if ((len != 64 + 8) && (len != 256 + 8)) { return 1; } if (!s_check_rem(s, len - 8)) { 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); LLOGLN(10, ("xrdp_sec_recv: client random - len %d", len)); LHEXDUMP(10, (self->client_random, 256)); LHEXDUMP(10, (self->client_crypt_random, len - 8)); 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 */ DEBUG((" out xrdp_sec_recv")); return 0; } if (flags & SEC_LOGON_INFO) /* 0x40 */ { if (xrdp_sec_process_logon_info(self, s) != 0) { DEBUG((" out xrdp_sec_recv error")); return 1; } if (self->rdp_layer->client_info.is_mce) { if (xrdp_sec_send_media_lic_response(self) != 0) { DEBUG((" out xrdp_sec_recv error")); return 1; } DEBUG((" out xrdp_sec_recv")); return -1; /* special error that means send demand active */ } if (xrdp_sec_send_lic_initial(self) != 0) { DEBUG((" out xrdp_sec_recv error")); return 1; } *chan = 1; /* just set a non existing channel and exit */ DEBUG((" out xrdp_sec_recv")); return 0; } if (flags & SEC_LICENCE_NEG) /* 0x80 */ { if (xrdp_sec_send_lic_response(self) != 0) { DEBUG((" out xrdp_sec_recv error")); 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; } DEBUG((" out xrdp_sec_recv")); return -1; /* special error that means send demand active */ } DEBUG((" out xrdp_sec_recv")); 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; LLOGLN(10, ("xrdp_sec_send:")); DEBUG((" in xrdp_sec_send")); s_pop_layer(s, sec_hdr); if (self->crypt_level > CRYPT_LEVEL_NONE) { if (self->crypt_level == CRYPT_LEVEL_FIPS) { LLOGLN(10, ("xrdp_sec_send: 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); } 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); } else { out_uint32_le(s, 0); } } if (xrdp_mcs_send(self->mcs_layer, s, chan) != 0) { return 1; } DEBUG((" out xrdp_sec_send")); 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) { 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]; LLOGLN(10, ("xrdp_sec_send_fastpath:")); error = 0; s_pop_layer(s, sec_hdr); if (self->crypt_level == CRYPT_LEVEL_FIPS) { LLOGLN(10, ("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); error = xrdp_fastpath_send(self->fastpath_layer, s); g_memcpy(s->p + 8 + datalen, save, pad); } else if (self->crypt_level > CRYPT_LEVEL_LOW) { LLOGLN(10, ("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); error = xrdp_fastpath_send(self->fastpath_layer, s); } else { LLOGLN(10, ("xrdp_sec_send_fastpath: no crypt")); pdulen = (int)(s->end - s->p); LLOGLN(10, ("xrdp_sec_send_fastpath: pdulen %d", pdulen)); secFlags = 0x0; fpOutputHeader = secFlags << 6; out_uint8(s, fpOutputHeader); pdulen |= 0x8000; out_uint16_be(s, pdulen); error = xrdp_fastpath_send(self->fastpath_layer, s); } if (error != 0) { 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) { int colorDepth; int postBeta2ColorDepth; int highColorDepth; int supportedColorDepths; int earlyCapabilityFlags; char clientName[INFO_CLIENT_NAME_BYTES / 2] = { '\0' }; in_uint8s(s, 4); /* version */ in_uint16_le(s, self->rdp_layer->client_info.width); in_uint16_le(s, self->rdp_layer->client_info.height); in_uint16_le(s, colorDepth); g_writeln("colorDepth 0x%4.4x (0xca00 4bpp 0xca01 8bpp)", colorDepth); switch (colorDepth) { case RNS_UD_COLOR_4BPP: self->rdp_layer->client_info.bpp = 4; break; case RNS_UD_COLOR_8BPP: self->rdp_layer->client_info.bpp = 8; break; } in_uint8s(s, 2); /* SASSequence */ in_uint8s(s, 4); /* keyboardLayout */ in_uint8s(s, 4); /* clientBuild */ unicode_utf16_in(s, INFO_CLIENT_NAME_BYTES - 2, clientName, sizeof(clientName) - 1); /* clientName */ log_message(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 */ in_uint16_le(s, postBeta2ColorDepth); g_writeln("postBeta2ColorDepth 0x%4.4x (0xca00 4bpp 0xca01 8bpp " "0xca02 15bpp 0xca03 16bpp 0xca04 24bpp)", postBeta2ColorDepth); switch (postBeta2ColorDepth) { case RNS_UD_COLOR_4BPP: self->rdp_layer->client_info.bpp = 4; break; case RNS_UD_COLOR_8BPP : self->rdp_layer->client_info.bpp = 8; break; case RNS_UD_COLOR_16BPP_555: self->rdp_layer->client_info.bpp = 15; break; case RNS_UD_COLOR_16BPP_565: self->rdp_layer->client_info.bpp = 16; break; case RNS_UD_COLOR_24BPP: self->rdp_layer->client_info.bpp = 24; break; } if (!s_check_rem(s, 2)) { return 0; } in_uint8s(s, 2); /* clientProductId */ if (!s_check_rem(s, 4)) { return 0; } in_uint8s(s, 4); /* serialNumber */ if (!s_check_rem(s, 2)) { return 0; } in_uint16_le(s, highColorDepth); g_writeln("highColorDepth 0x%4.4x (0x0004 4bpp 0x0008 8bpp 0x000f 15bpp " "0x0010 16 bpp 0x0018 24bpp)", highColorDepth); self->rdp_layer->client_info.bpp = highColorDepth; if (!s_check_rem(s, 2)) { return 0; } in_uint16_le(s, supportedColorDepths); g_writeln("supportedColorDepths 0x%4.4x (0x0001 24bpp 0x0002 16bpp " "0x0004 15bpp 0x0008 32bpp)", supportedColorDepths); if (!s_check_rem(s, 2)) { return 0; } in_uint16_le(s, earlyCapabilityFlags); self->rdp_layer->client_info.mcs_early_capability_flags = earlyCapabilityFlags; g_writeln("earlyCapabilityFlags 0x%4.4x (0x0002 want32)", earlyCapabilityFlags); if ((earlyCapabilityFlags & 0x0002) && (supportedColorDepths & 0x0008)) { self->rdp_layer->client_info.bpp = 32; } if (!s_check_rem(s, 64)) { return 0; } in_uint8s(s, 64); /* clientDigProductId */ if (!s_check_rem(s, 1)) { return 0; } in_uint8(s, self->rdp_layer->client_info.mcs_connection_type); /* connectionType */ g_writeln("got client client connection type 0x%8.8x", self->rdp_layer->client_info.mcs_connection_type); if (!s_check_rem(s, 1)) { return 0; } in_uint8s(s, 1); /* pad1octet */ if (!s_check_rem(s, 4)) { return 0; } in_uint8s(s, 4); /* serverSelectedProtocol */ if (!s_check_rem(s, 4)) { return 0; } in_uint8s(s, 4); /* desktopPhysicalWidth */ if (!s_check_rem(s, 4)) { return 0; } in_uint8s(s, 4); /* desktopPhysicalHeight */ if (!s_check_rem(s, 2)) { return 0; } in_uint8s(s, 2); /* reserved */ return 0; } /*****************************************************************************/ static int xrdp_sec_process_mcs_data_CS_SECURITY(struct xrdp_sec *self, struct stream* s) { int crypt_method; int found; g_writeln("xrdp_sec_process_mcs_data_CS_SECURITY:"); in_uint32_le(s, crypt_method); if (crypt_method & CRYPT_METHOD_40BIT) { g_writeln(" client supports 40 bit encryption"); } if (crypt_method & CRYPT_METHOD_128BIT) { g_writeln(" client supports 128 bit encryption"); } if (crypt_method & CRYPT_METHOD_56BIT) { g_writeln(" client supports 56 bit encryption"); } if (crypt_method & CRYPT_METHOD_FIPS) { g_writeln(" client supports fips encryption"); } found = 0; if ((found == 0) && (self->crypt_method & CRYPT_METHOD_FIPS) && (self->crypt_level == CRYPT_LEVEL_FIPS)) { if (crypt_method & CRYPT_METHOD_FIPS) { g_writeln(" client and server support fips, using fips"); 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) { g_writeln(" client and server support high crypt, using " "high crypt"); self->crypt_method = CRYPT_METHOD_128BIT; self->crypt_level = CRYPT_LEVEL_HIGH; found = 1; } } if ((found == 0) && (self->crypt_method & CRYPT_METHOD_40BIT) && (self->crypt_level == CRYPT_LEVEL_CLIENT_COMPATIBLE)) { if (crypt_method & CRYPT_METHOD_40BIT) { g_writeln(" client and server support medium crypt, using " "medium crypt"); 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) { g_writeln(" client and server support low crypt, using " "low crypt"); 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) { g_writeln(" client and server support none crypt, using " "none crypt"); self->crypt_method = CRYPT_METHOD_NONE; self->crypt_level = CRYPT_LEVEL_NONE; found = 1; } } // if (found == 0) // { // g_writeln(" can not find client / server agreed encryption method"); // return 1; // } return 0; } /*****************************************************************************/ /* 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; client_info = &(self->rdp_layer->client_info); DEBUG(("processing channels, channels_allowed is %d", client_info->channels_allowed)); /* this is an option set in xrdp.ini */ if (client_info->channels_allowed == 0) /* are channels on? */ { log_message(LOG_LEVEL_INFO, "all channels are disabled by " "configuration"); return 0; } if (!s_check_rem(s, 4)) { return 1; } in_uint32_le(s, num_channels); if (num_channels > 31) { return 1; } for (index = 0; index < num_channels; index++) { channel_item = g_new0(struct mcs_channel_item, 1); if (!s_check_rem(s, 12)) { 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) { channel_item->chanid = MCS_GLOBAL_CHANNEL + (index + 1); log_message(LOG_LEVEL_INFO, "adding channel item name %s chan_id " "%d flags 0x%8.8x", channel_item->name, channel_item->chanid, channel_item->flags); list_add_item(self->mcs_layer->channel_list, (intptr_t) channel_item); DEBUG(("got channel flags %8.8x name %s", channel_item->flags, channel_item->name)); } else { g_free(channel_item); } } return 0; } /*****************************************************************************/ /* reads the client monitors data */ static int xrdp_sec_process_mcs_data_monitors(struct xrdp_sec *self, struct stream *s) { int index; int monitorCount; int flags; int x1; int y1; int x2; int y2; int got_primary; struct xrdp_client_info *client_info = (struct xrdp_client_info *)NULL; client_info = &(self->rdp_layer->client_info); LLOGLN(10, ("xrdp_sec_process_mcs_data_monitors: processing monitors data, allow_multimon is %d", client_info->multimon)); /* this is an option set in xrdp.ini */ if (client_info->multimon != 1) /* are multi-monitors allowed ? */ { LLOGLN(0, ("[INFO] xrdp_sec_process_mcs_data_monitors: multimon is not " "allowed, skipping")); return 0; } in_uint32_le(s, flags); /* flags */ //verify flags - must be 0x0 if (flags != 0) { LLOGLN(0, ("[ERROR] xrdp_sec_process_mcs_data_monitors: flags MUST be " "zero, detected: %d", flags)); return 1; } in_uint32_le(s, monitorCount); //verify monitorCount - max 16 if (monitorCount > 16) { LLOGLN(0, ("[ERROR] xrdp_sec_process_mcs_data_monitors: max allowed " "monitors is 16, detected: %d", monitorCount)); return 1; } LLOGLN(10, ("xrdp_sec_process_mcs_data_monitors: monitorCount= %d", monitorCount)); client_info->monitorCount = monitorCount; x1 = 0; y1 = 0; x2 = 0; y2 = 0; got_primary = 0; /* Add client_monitor_data to client_info struct, will later pass to X11rdp */ for (index = 0; index < monitorCount; index++) { in_uint32_le(s, client_info->minfo[index].left); in_uint32_le(s, client_info->minfo[index].top); in_uint32_le(s, client_info->minfo[index].right); in_uint32_le(s, client_info->minfo[index].bottom); in_uint32_le(s, client_info->minfo[index].is_primary); if (index == 0) { x1 = client_info->minfo[index].left; y1 = client_info->minfo[index].top; x2 = client_info->minfo[index].right; y2 = client_info->minfo[index].bottom; } else { x1 = MIN(x1, client_info->minfo[index].left); y1 = MIN(y1, client_info->minfo[index].top); x2 = MAX(x2, client_info->minfo[index].right); y2 = MAX(y2, client_info->minfo[index].bottom); } if (client_info->minfo[index].is_primary) { got_primary = 1; } LLOGLN(10, ("xrdp_sec_process_mcs_data_monitors: got a monitor [%d]: left= %d, top= %d, right= %d, bottom= %d, is_primary?= %d", index, client_info->minfo[index].left, client_info->minfo[index].top, client_info->minfo[index].right, client_info->minfo[index].bottom, client_info->minfo[index].is_primary)); } if (!got_primary) { /* no primary monitor was set, choose the leftmost monitor as primary */ for (index = 0; index < monitorCount; index++) { if (client_info->minfo[index].left == x1 && client_info->minfo[index].top == y1) { client_info->minfo[index].is_primary = 1; break; } } } /* set wm geometry */ if ((x2 > x1) && (y2 > y1)) { client_info->width = (x2 - x1) + 1; client_info->height = (y2 - y1) + 1; } /* make sure virtual desktop size is ok */ if (client_info->width > 0x7FFE || client_info->width < 0xC8 || client_info->height > 0x7FFE || client_info->height < 0xC8) { LLOGLN(0, ("[ERROR] xrdp_sec_process_mcs_data_monitors: error, virtual desktop width / height is too large")); return 1; /* error */ } /* keep a copy of non negative monitor info values for xrdp_wm usage */ for (index = 0; index < monitorCount; index++) { client_info->minfo_wm[index].left = client_info->minfo[index].left - x1; client_info->minfo_wm[index].top = client_info->minfo[index].top - y1; client_info->minfo_wm[index].right = client_info->minfo[index].right - x1; client_info->minfo_wm[index].bottom = client_info->minfo[index].bottom - y1; client_info->minfo_wm[index].is_primary = client_info->minfo[index].is_primary; } return 0; } /*****************************************************************************/ /* 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; s = &(self->client_mcs_data); /* set p to beginning */ s->p = s->data; /* skip header */ if (!s_check_rem(s, 23)) { return 1; } in_uint8s(s, 23); while (s_check_rem(s, 4)) { hold_p = s->p; in_uint16_le(s, tag); in_uint16_le(s, size); if ((size < 4) || (!s_check_rem(s, size - 4))) { LLOGLN(0, ("error in xrdp_sec_process_mcs_data tag %d size %d", tag, size)); break; } LLOGLN(10, ("xrdp_sec_process_mcs_data: 0x%8.8x", tag)); switch (tag) { case SEC_TAG_CLI_INFO: /* CS_CORE 0xC001 */ if (xrdp_sec_process_mcs_data_CS_CORE(self, s) != 0) { return 1; } break; case SEC_TAG_CLI_CRYPT: /* CS_SECURITY 0xC002 */ if (xrdp_sec_process_mcs_data_CS_SECURITY(self, s) != 0) { return 1; } break; case SEC_TAG_CLI_CHANNELS: /* CS_NET 0xC003 */ if (xrdp_sec_process_mcs_data_channels(self, s) != 0) { return 1; } break; case SEC_TAG_CLI_4: /* CS_CLUSTER 0xC004 */ break; case SEC_TAG_CLI_MONITOR: /* CS_MONITOR 0xC005 */ if (xrdp_sec_process_mcs_data_monitors(self, s) != 0) { return 1; } break; /* CS_MCS_MSGCHANNEL 0xC006 CS_MONITOR_EX 0xC008 CS_MULTITRANSPORT 0xC00A SC_CORE 0x0C01 SC_SECURITY 0x0C02 SC_NET 0x0C03 SC_MCS_MSGCHANNEL 0x0C04 SC_MULTITRANSPORT 0x0C08 */ default: LLOGLN(0, ("error unknown xrdp_sec_process_mcs_data " "tag 0x%4.4x size %d", tag, size)); break; } s->p = hold_p + size; } if (self->rdp_layer->client_info.max_bpp > 0) { if (self->rdp_layer->client_info.bpp > self->rdp_layer->client_info.max_bpp) { LLOGLN(0, ("xrdp_rdp_parse_client_mcs_data: client asked " "for %dbpp connection but configuration is limited " "to %dbpp", self->rdp_layer->client_info.bpp, self->rdp_layer->client_info.max_bpp)); self->rdp_layer->client_info.bpp = self->rdp_layer->client_info.max_bpp; } } /* set p to beginning */ s->p = s->data; return 0; } /*****************************************************************************/ /* process the mcs client data we received from the mcs layer */ 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; int index = 0; char c = 0; 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(s, 47)) { return 1; } in_uint8s(s, 47); g_memset(client_info->hostname, 0, 32); c = 1; index = 0; while (index < 16 && c != 0) { if (!s_check_rem(s, 2)) { return 1; } in_uint8(s, c); in_uint8s(s, 1); client_info->hostname[index] = c; index++; } /* get build */ s->p = s->data; if (!s_check_rem(s, 43 + 4)) { return 1; } in_uint8s(s, 43); in_uint32_le(s, client_info->build); /* get keylayout */ s->p = s->data; if (!s_check_rem(s, 39 + 4)) { return 1; } in_uint8s(s, 39); in_uint32_le(s, client_info->keylayout); /* get keyboard type / subtype */ s->p = s->data; if (!s_check_rem(s, 79 + 8)) { return 1; } in_uint8s(s, 79); in_uint32_le(s, client_info->keyboard_type); in_uint32_le(s, 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: g_writeln("Fatal : Illegal crypt_level"); break ; } if (self->decrypt_rc4_info != NULL) { g_writeln("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) { g_writeln("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]; DEBUG((" in xrdp_sec_incoming:")); iso = self->mcs_layer->iso_layer; /* negotiate security layer */ if (xrdp_iso_incoming(iso) != 0) { DEBUG(("xrdp_sec_incoming: xrdp_iso_incoming failed")); return 1; } /* initialize selected security layer */ if (iso->selectedProtocol > PROTOCOL_RDP) { /* init tls security */ DEBUG((" in xrdp_sec_incoming: 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) { g_writeln("xrdp_sec_incoming: trans_set_tls_mode failed"); return 1; } self->crypt_level = CRYPT_LEVEL_NONE; self->crypt_method = CRYPT_METHOD_NONE; self->rsa_key_bytes = 0; } else { /* init rdp security */ DEBUG((" in xrdp_sec_incoming: init rdp security")); if (xrdp_sec_init_rdp_security(self) != 0) { DEBUG(("xrdp_sec_incoming: xrdp_sec_init_rdp_security failed")); return 1; } if (self->crypt_method != CRYPT_METHOD_NONE) { 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_message(LOG_LEVEL_ALWAYS, "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; g_writeln("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; g_writeln("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) { g_writeln("warning, RSA key len 512 " "bits or less, consider creating a 2048 bit key"); log_message(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) { return 1; } #ifdef XRDP_DEBUG g_writeln("client mcs data received"); g_hexdump(self->client_mcs_data.data, (int)(self->client_mcs_data.end - self->client_mcs_data.data)); g_writeln("server mcs data sent"); g_hexdump(self->server_mcs_data.data, (int)(self->server_mcs_data.end - self->server_mcs_data.data)); #endif DEBUG((" out xrdp_sec_incoming")); if (xrdp_sec_in_mcs_data(self) != 0) { return 1; } LLOGLN(10, ("xrdp_sec_incoming: out")); return 0; } /*****************************************************************************/ int xrdp_sec_disconnect(struct xrdp_sec *self) { int rv; DEBUG((" in xrdp_sec_disconnect")); rv = xrdp_mcs_disconnect(self->mcs_layer); DEBUG((" out xrdp_sec_disconnect")); return rv; } xrdp-0.9.12/libxrdp/xrdp_orders.c000644 001751 001751 00000243421 13544635323 016661 0ustar00metameta000000 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" #if defined(XRDP_NEUTRINORDP) #include #endif #define LLOG_LEVEL 2 #define LLOGLN(_log_level, _params) \ { \ if (_log_level < LLOG_LEVEL) \ { \ g_write("xrdp_orders.c [%10.10u]: ", g_time3()); \ g_writeln _params ; \ } \ } #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) { 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) { LLOGLN(10, ("xrdp_orders_init: fastpath")); if (xrdp_rdp_init_fastpath(self->rdp_layer, self->out_s) != 0) { return 1; } self->order_count_ptr = self->out_s->p; out_uint8s(self->out_s, 2); /* number of orders, set later */ } else { LLOGLN(10, ("xrdp_orders_init: slowpath")); if (xrdp_rdp_init_data(self->rdp_layer, self->out_s) != 0) { return 1; } out_uint16_le(self->out_s, RDP_UPDATE_ORDERS); 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 */ } } 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); DEBUG(("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) { rv = 1; } } else { if (xrdp_rdp_send_data(self->rdp_layer, self->out_s, RDP_DATA_PDU_UPDATE) != 0) { 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); DEBUG(("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) { return 1; } else { xrdp_orders_init(self); return 0; } } size = (int)(self->out_s->p - self->order_count_ptr); if (size < 0) { g_writeln("error in xrdp_orders_check, size too small: %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 */ g_writeln("error in xrdp_orders_check, size too big: %d bytes", 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) { return 1; } self->order_count++; order_flags = TS_STANDARD | TS_SECONDARY; out_uint8(self->out_s, order_flags); len = 1027 - 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_COLOR_TABLE); /* type */ 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); } 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) { g_writeln("error, width > 64"); return 1; } if (height > 64) { g_writeln("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) { g_writeln("error, width > 64"); return 1; } if (height > 64) { g_writeln("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) { g_writeln("error, width > 64"); return 1; } if (height > 64) { g_writeln("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) { g_writeln("error, width > 64"); return 1; } if (height > 64) { g_writeln("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; } LLOGLN(10, ("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; } LLOGLN(10, ("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)) { LLOGLN(10, ("xrdp_orders_send_bitmap3: jpeg skipped")); return 2; } LLOGLN(10, ("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 { g_writeln("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; LLOGLN(10, ("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.9.12/libxrdp/xrdp_surface.c000644 001751 001751 00000012075 13544635323 017012 0ustar00metameta000000 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; char *buf; int Bpp; int i; int j; 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 { g_writeln("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.9.12/libxrdp/libxrdp.h000644 001751 001751 00000045720 13544635323 016001 0ustar00metameta000000 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 "file.h" #include "libxrdpinc.h" #include "xrdp_client_info.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; }; /* 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 */ 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); /* xrdp_rdp.c */ 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_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); /* 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.9.12/libxrdp/xrdp_rdp.c000644 001751 001751 00000121155 13601643631 016142 0ustar00metameta000000 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 "log.h" #include "ssl_calls.h" #if defined(XRDP_NEUTRINORDP) #include #include #endif #define LOG_LEVEL 1 #define LLOG(_level, _args) \ do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0) #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { g_writeln _args ; } } while (0) #define FASTPATH_FRAG_SIZE (16 * 1024 - 128) /*****************************************************************************/ static int xrdp_rdp_read_config(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; char cfg_file[256]; int pos; char *tmp = NULL; int tmp_length = 0; /* initialize (zero out) local variables: */ g_memset(cfg_file, 0, sizeof(char) * 256); items = list_create(); items->auto_free = 1; values = list_create(); values->auto_free = 1; g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); DEBUG(("cfg_file %s", cfg_file)); file_by_name_read_section(cfg_file, "globals", items, values); for (index = 0; index < items->count; index++) { item = (char *)list_get_item(items, index); value = (char *)list_get_item(values, index); 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_message(LOG_LEVEL_ALWAYS,"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_message(LOG_LEVEL_DEBUG,"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_message(LOG_LEVEL_DEBUG,"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, "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_message(LOG_LEVEL_ALWAYS,"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_message(LOG_LEVEL_ERROR, "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_message(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_message(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_message(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_message(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_message(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_message(LOG_LEVEL_ERROR, "Cannot read private key file %s: %s", client_info->key_file, g_get_strerror()); } } } 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)) { DEBUG(("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; int bytes; DEBUG(("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(&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 */ bytes = sizeof(self->client_info.client_ip) - 1; g_write_ip_address(trans->sck, self->client_info.client_ip, bytes); 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); DEBUG(("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); } /*****************************************************************************/ int xrdp_rdp_init(struct xrdp_rdp *self, struct stream *s) { if (xrdp_sec_init(self->sec_layer, s) != 0) { return 1; } s_push_layer(s, rdp_hdr, 6); return 0; } /*****************************************************************************/ int xrdp_rdp_init_data(struct xrdp_rdp *self, struct stream *s) { if (xrdp_sec_init(self->sec_layer, s) != 0) { return 1; } s_push_layer(s, rdp_hdr, 18); return 0; } /*****************************************************************************/ /* 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; DEBUG(("in xrdp_rdp_recv")); 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) { return 1; } /* next_packet gets set in xrdp_sec_recv_fastpath */ *code = 2; // special code for fastpath input DEBUG(("out (fastpath) xrdp_rdp_recv")); 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; DEBUG(("out (1) xrdp_rdp_recv")); return 0; } if (error != 0) { DEBUG(("out xrdp_rdp_recv error")); g_writeln("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) { g_writeln("xrdp_channel_process returned unhandled error") ; } } else { if (chan != 1) { g_writeln("Wrong channel Id to be handled by xrdp_channel_process %d", chan); } } s->next_packet = 0; *code = 0; DEBUG(("out (2) xrdp_rdp_recv")); return 0; } s->next_packet = s->p; } else { DEBUG(("xrdp_rdp_recv stream not touched")) s->p = s->next_packet; } if (!s_check_rem(s, 6)) { s->next_packet = 0; *code = 0; DEBUG(("out (3) xrdp_rdp_recv")); len = (int)(s->end - s->p); g_writeln("xrdp_rdp_recv: bad RDP packet, length [%d]", len); return 0; } else { in_uint16_le(s, len); /*g_writeln("New len received : %d next packet: %d s_end: %d",len,s->next_packet,s->end); */ in_uint16_le(s, pdu_code); *code = pdu_code & 0xf; in_uint8s(s, 2); /* mcs user id */ s->next_packet += len; DEBUG(("out (4) xrdp_rdp_recv")); return 0; } } /*****************************************************************************/ int xrdp_rdp_send(struct xrdp_rdp *self, struct stream *s, int pdu_type) { int len = 0; DEBUG(("in xrdp_rdp_send")); s_pop_layer(s, rdp_hdr); len = s->end - s->p; out_uint16_le(s, len); out_uint16_le(s, 0x10 | pdu_type); out_uint16_le(s, self->mcs_channel); if (xrdp_sec_send(self->sec_layer, s, MCS_GLOBAL_CHANNEL) != 0) { DEBUG(("out xrdp_rdp_send error")); return 1; } DEBUG(("out xrdp_rdp_send")); return 0; } /*****************************************************************************/ int xrdp_rdp_send_data(struct xrdp_rdp *self, struct stream *s, int data_pdu_type) { 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; DEBUG(("in xrdp_rdp_send_data")); 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 (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)) { DEBUG(("mppc_encode ok flags 0x%x bytes_in_opb %d historyOffset %d " "tocomplen %d", mppc_enc->flags, mppc_enc->bytes_in_opb, mppc_enc->historyOffset, 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 = clen; 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 { LLOGLN(10, ("xrdp_rdp_send_data: mppc_encode not ok " "type %d flags %d", mppc_enc->protocol_type, mppc_enc->flags)); } } out_uint16_le(s, pdulen); out_uint16_le(s, pdutype); out_uint16_le(s, self->mcs_channel); out_uint32_le(s, self->share_id); out_uint8(s, 0); out_uint8(s, 1); out_uint16_le(s, dlen); out_uint8(s, data_pdu_type); out_uint8(s, ctype); out_uint16_le(s, clen); if (xrdp_sec_send(self->sec_layer, s, MCS_GLOBAL_CHANNEL) != 0) { DEBUG(("out xrdp_rdp_send_data error")); return 1; } DEBUG(("out xrdp_rdp_send_data")); return 0; } /*****************************************************************************/ /* 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) { 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; LLOGLN(10, ("xrdp_rdp_send_fastpath:")); 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; LLOGLN(10, ("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; LLOGLN(10, ("xrdp_rdp_send_fastpath: no_comp_len %d " "comp_len %d", no_comp_len, comp_len)); 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 { LLOGLN(10, ("xrdp_rdp_send_fastpath: mppc_encode not ok " "type %d flags %d", mppc_enc->protocol_type, mppc_enc->flags)); } } updateHeader = (updateCode & 15) | ((fragmentation & 3) << 4) | ((compression & 3) << 6); out_uint8(&send_s, updateHeader); if (compression != 0) { out_uint8(&send_s, comp_type); } send_len -= header_bytes; out_uint16_le(&send_s, send_len); send_s.end = send_s.p + send_len; if (xrdp_sec_send_fastpath(self->sec_layer, &send_s) != 0) { LLOGLN(0, ("xrdp_rdp_send_fastpath: xrdp_fastpath_send 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; } /*****************************************************************************/ int xrdp_rdp_send_data_update_sync(struct xrdp_rdp *self) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 8192); DEBUG(("in xrdp_rdp_send_data_update_sync")); if (self->client_info.use_fast_path & 1) /* fastpath output supported */ { LLOGLN(10, ("xrdp_rdp_send_data_update_sync: fastpath")); if (xrdp_rdp_init_fastpath(self, s) != 0) { free_stream(s); return 1; } } else /* slowpath */ { if (xrdp_rdp_init_data(self, s) != 0) { DEBUG(("out xrdp_rdp_send_data_update_sync error")); free_stream(s); return 1; } out_uint16_le(s, RDP_UPDATE_SYNCHRONIZE); out_uint16_le(s, 0); /* pad */ } s_mark_end(s); if (self->client_info.use_fast_path & 1) /* fastpath output supported */ { if (xrdp_rdp_send_fastpath(self, s, FASTPATH_UPDATETYPE_SYNCHRONIZE) != 0) { free_stream(s); return 1; } } else /* slowpath */ { if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_UPDATE) != 0) { DEBUG(("out xrdp_rdp_send_data_update_sync error")); free_stream(s); return 1; } } DEBUG(("out xrdp_rdp_send_data_update_sync")); 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; DEBUG(("in xrdp_rdp_incoming")); if (xrdp_sec_incoming(self->sec_layer) != 0) { return 1; } self->mcs_channel = self->sec_layer->mcs_layer->userid + MCS_USERCHANNEL_BASE; DEBUG(("out xrdp_rdp_incoming mcs channel %d", self->mcs_channel)); g_strncpy(self->client_info.client_addr, iso->trans->addr, sizeof(self->client_info.client_addr) - 1); g_strncpy(self->client_info.client_port, iso->trans->port, sizeof(self->client_info.client_port) - 1); /* log TLS version and cipher of TLS connections */ if (iso->selectedProtocol > PROTOCOL_RDP) { log_message(LOG_LEVEL_INFO, "TLS connection established from %s port %s: %s with cipher %s", self->client_info.client_addr, self->client_info.client_port, iso->trans->ssl_protocol, iso->trans->cipher_name); } /* log non-TLS connections */ else { log_message(LOG_LEVEL_INFO, "Non-TLS connection established from %s port %s: " "encrypted with standard RDP security", self->client_info.client_addr, self->client_info.client_port); } return 0; } /*****************************************************************************/ static int xrdp_rdp_process_data_pointer(struct xrdp_rdp *self, struct stream *s) { return 0; } /*****************************************************************************/ /* RDP_DATA_PDU_INPUT */ 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(s, 4)) { return 1; } in_uint16_le(s, num_events); in_uint8s(s, 2); /* pad */ DEBUG(("in xrdp_rdp_process_data_input %d events", num_events)); for (index = 0; index < num_events; index++) { if (!s_check_rem(s, 12)) { 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); DEBUG(("xrdp_rdp_process_data_input event %4.4x flags %4.4x param1 %d " "param2 %d time %d", msg_type, device_flags, param1, param2, time)); 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); } } DEBUG(("out xrdp_rdp_process_data_input")); return 0; } /*****************************************************************************/ 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) { 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); if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_SYNCHRONISE) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ 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) { 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); if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_CONTROL) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ static int xrdp_rdp_process_data_control(struct xrdp_rdp *self, struct stream *s) { int action; DEBUG(("xrdp_rdp_process_data_control")); in_uint16_le(s, action); in_uint8s(s, 2); /* user id */ in_uint8s(s, 4); /* control id */ if (action == RDP_CTL_REQUEST_CONTROL) { DEBUG(("xrdp_rdp_process_data_control got RDP_CTL_REQUEST_CONTROL")); DEBUG(("xrdp_rdp_process_data_control calling xrdp_rdp_send_synchronise")); xrdp_rdp_send_synchronise(self); DEBUG(("xrdp_rdp_process_data_control sending RDP_CTL_COOPERATE")); xrdp_rdp_send_control(self, RDP_CTL_COOPERATE); DEBUG(("xrdp_rdp_process_data_control sending RDP_CTL_GRANT_CONTROL")); xrdp_rdp_send_control(self, RDP_CTL_GRANT_CONTROL); } else { DEBUG(("xrdp_rdp_process_data_control unknown action")); } return 0; } /*****************************************************************************/ static int xrdp_rdp_process_data_sync(struct xrdp_rdp *self) { DEBUG(("xrdp_rdp_process_data_sync")); 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(s, 4)) { return 1; } in_uint8(s, num_rects); in_uint8s(s, 3); /* pad */ g_writeln("xrdp_rdp_process_screen_update: num_rects %d", num_rects); for (index = 0; index < num_rects; index++) { if (!s_check_rem(s, 8)) { 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); g_writeln(" 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); } } return 0; } /*****************************************************************************/ 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) { 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); if (xrdp_rdp_send_data(self, s, 0x28) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ static int xrdp_rdp_process_data_font(struct xrdp_rdp *self, struct stream *s) { int seq; DEBUG(("in xrdp_rdp_process_data_font")); 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 */ /* 419 client sends Seq 1, then 2 */ /* 2600 clients sends only Seq 3 */ if (seq == 2 || seq == 3) /* after second font message, we are up and */ { /* running */ DEBUG(("sending fontmap")); xrdp_rdp_send_fontmap(self); self->session->up_and_running = 1; g_writeln("yeah, up_and_running"); DEBUG(("up_and_running set")); xrdp_rdp_send_data_update_sync(self); xrdp_channel_drdynvc_start(self->sec_layer->chan_layer); } DEBUG(("out xrdp_rdp_process_data_font")); return 0; } /*****************************************************************************/ /* sent 37 pdu */ 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) { free_stream(s); return 1; } s_mark_end(s); if (xrdp_rdp_send_data(self, s, 37) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } #if 0 /* not used */ /*****************************************************************************/ /* sent RDP_DATA_PDU_DISCONNECT 47 pdu */ 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) { free_stream(s); return 1; } out_uint32_le(s, reason); s_mark_end(s); if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_DISCONNECT) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } #endif /*****************************************************************************/ static int xrdp_rdp_process_frame_ack(struct xrdp_rdp *self, struct stream *s) { int frame_id; //g_writeln("xrdp_rdp_process_frame_ack:"); in_uint32_le(s, frame_id); //g_writeln(" frame_id %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); } return 0; } /*****************************************************************************/ static int xrdp_rdp_process_suppress(struct xrdp_rdp *self, struct stream *s) { int allowDisplayUpdates; int left; int top; int right; int bottom; if (!s_check_rem(s, 1)) { return 1; } in_uint8(s, allowDisplayUpdates); g_writeln("xrdp_rdp_process_suppress: allowDisplayUpdates %d bytes " "left %d", allowDisplayUpdates, (int) (s->end - s->p)); switch (allowDisplayUpdates) { case 0: /* SUPPRESS_DISPLAY_UPDATES */ self->client_info.suppress_output = 1; g_writeln("xrdp_rdp_process_suppress: suppress_output %d", self->client_info.suppress_output); if (self->session->callback != 0) { self->session->callback(self->session->id, 0x5559, 1, 0, 0, 0); } break; case 1: /* ALLOW_DISPLAY_UPDATES */ self->client_info.suppress_output = 0; if (!s_check_rem(s, 11)) { return 1; } 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); g_writeln("xrdp_rdp_process_suppress: suppress_output %d " "left %d top %d right %d bottom %d", self->client_info.suppress_output, left, top, right, bottom); if (self->session->callback != 0) { self->session->callback(self->session->id, 0x5559, 0, MAKELONG(left, top), MAKELONG(right, bottom), 0); } break; } return 0; } /*****************************************************************************/ /* RDP_PDU_DATA */ int xrdp_rdp_process_data(struct xrdp_rdp *self, struct stream *s) { int uncompressedLength; int pduType2; int compressedType; int compressedLength; if (!s_check_rem(s, 12)) { return 1; } in_uint8s(s, 6); in_uint16_le(s, uncompressedLength); in_uint8(s, pduType2); in_uint8(s, compressedType); in_uint16_le(s, compressedLength); if (compressedType != 0) { /* don't support compression */ return 1; } if (compressedLength > uncompressedLength) { return 1; } DEBUG(("xrdp_rdp_process_data pduType2 %d", pduType2)); 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 35: /* 35(0x23) PDUTYPE2_SUPPRESS_OUTPUT */ xrdp_rdp_process_suppress(self, s); break; case 36: /* 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 */ 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: g_writeln("unknown in xrdp_rdp_process_data pduType2 %d", pduType2); break; } return 0; } /*****************************************************************************/ int xrdp_rdp_disconnect(struct xrdp_rdp *self) { int rv; DEBUG(("in xrdp_rdp_disconnect")); rv = xrdp_sec_disconnect(self->sec_layer); DEBUG(("out xrdp_rdp_disconnect")); return rv; } /*****************************************************************************/ int xrdp_rdp_send_deactivate(struct xrdp_rdp *self) { struct stream *s; DEBUG(("in xrdp_rdp_send_deactivate")); make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init(self, s) != 0) { free_stream(s); DEBUG(("out xrdp_rdp_send_deactivate error")); return 1; } s_mark_end(s); if (xrdp_rdp_send(self, s, PDUTYPE_DEACTIVATEALLPDU) != 0) { free_stream(s); DEBUG(("out xrdp_rdp_send_deactivate error")); return 1; } free_stream(s); DEBUG(("out xrdp_rdp_send_deactivate")); return 0; } /*****************************************************************************/ int xrdp_rdp_send_session_info(struct xrdp_rdp *self, const char *data, int data_bytes) { struct stream *s; LLOGLN(0, ("xrdp_rdp_send_session_info: data_bytes %d", data_bytes)); make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data(self, s) != 0) { free_stream(s); return 1; } if (s_check_rem_out(s, data_bytes)) { out_uint8a(s, data, data_bytes); } else { free_stream(s); return 1; } s_mark_end(s); if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_LOGON) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } xrdp-0.9.12/libxrdp/xrdp_iso.c000644 001751 001751 00000025633 13544635323 016160 0ustar00metameta000000 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 */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "log.h" #define LOG_LEVEL 1 #define LLOG(_level, _args) \ do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0) #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { g_writeln _args ; } } while (0) #define LHEXDUMP(_level, _args) \ do { if (_level < LOG_LEVEL) { g_hexdump _args ; } } while (0) /*****************************************************************************/ struct xrdp_iso * xrdp_iso_create(struct xrdp_mcs *owner, struct trans *trans) { struct xrdp_iso *self; LLOGLN(10, (" in xrdp_iso_create")); self = (struct xrdp_iso *) g_malloc(sizeof(struct xrdp_iso), 1); self->mcs_layer = owner; self->trans = trans; LLOGLN(10, (" out xrdp_iso_create")); 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) { int rv = 0; struct xrdp_client_info *client_info = &(self->mcs_layer->sec_layer->rdp_layer->client_info); self->selectedProtocol = client_info->security_layer; switch (client_info->security_layer) { case PROTOCOL_RDP: break; case PROTOCOL_SSL: if (self->requestedProtocol & PROTOCOL_SSL) { if (!g_file_readable(client_info->certificate) || !g_file_readable(client_info->key_file)) { /* certificate or privkey is not readable */ log_message(LOG_LEVEL_DEBUG, "No readable certificates or " "private keys, cannot accept TLS connections"); self->failureCode = SSL_CERT_NOT_ON_SERVER; rv = 1; /* error */ } else { self->selectedProtocol = PROTOCOL_SSL; } } else { self->failureCode = SSL_REQUIRED_BY_SERVER; rv = 1; /* error */ } break; case PROTOCOL_HYBRID: case PROTOCOL_HYBRID_EX: default: if ((self->requestedProtocol & PROTOCOL_SSL) && g_file_readable(client_info->certificate) && g_file_readable(client_info->key_file)) { /* that's a patch since we don't support CredSSP for now */ self->selectedProtocol = PROTOCOL_SSL; } else { self->selectedProtocol = PROTOCOL_RDP; } break; } log_message(LOG_LEVEL_DEBUG, "Security layer: requested %d, selected %d", self->requestedProtocol, self->selectedProtocol); return rv; } /*****************************************************************************/ /* returns error */ static int xrdp_iso_process_rdp_neg_req(struct xrdp_iso *self, struct stream *s) { int flags; int len; in_uint8(s, flags); if (flags != 0x0 && flags != 0x8 && flags != 0x1) { LLOGLN(10, ("xrdp_iso_process_rdpNegReq: error, flags: %x",flags)); return 1; } in_uint16_le(s, len); if (len != 8) { LLOGLN(10, ("xrdp_iso_process_rdpNegReq: error, length: %x",len)); return 1; } in_uint32_le(s, self->requestedProtocol); if (self->requestedProtocol > 0xb) { LLOGLN(10, ("xrdp_iso_process_rdpNegReq: error, requestedProtocol: %x", self->requestedProtocol)); return 1; } return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_iso_recv_msg(struct xrdp_iso *self, struct stream *s, int *code, int *len) { int ver; int plen; *code = 0; *len = 0; if (s != self->trans->in_s) { LLOGLN(10, ("xrdp_iso_recv_msg error logic")); } in_uint8(s, ver); if (ver != 3) { LLOGLN(10, ("xrdp_iso_recv_msg: bad ver")); LHEXDUMP(10, (s->data, 4)); return 1; } in_uint8s(s, 1); in_uint16_be(s, plen); if (plen < 4) { return 1; } if (!s_check_rem(s, 2)) { return 1; } in_uint8(s, *len); in_uint8(s, *code); if (*code == ISO_PDU_DT) { if (!s_check_rem(s, 1)) { return 1; } in_uint8s(s, 1); } else { if (!s_check_rem(s, 5)) { return 1; } in_uint8s(s, 5); } return 0; } /*****************************************************************************/ /* returns error */ int xrdp_iso_recv(struct xrdp_iso *self, struct stream *s) { int code; int len; LLOGLN(10, (" in xrdp_iso_recv")); if (xrdp_iso_recv_msg(self, s, &code, &len) != 0) { LLOGLN(10, (" out xrdp_iso_recv xrdp_iso_recv_msg return non zero")); return 1; } if (code != ISO_PDU_DT || len != 2) { LLOGLN(10, (" out xrdp_iso_recv code != ISO_PDU_DT or length != 2")); return 1; } LLOGLN(10, (" out xrdp_iso_recv")); return 0; } /*****************************************************************************/ 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; /* tpkt */ out_uint8(s, 3); /* version */ out_uint8(s, 0); /* pad */ len_ptr = s->p; out_uint16_be(s, 0); /* length, set later */ /* iso */ 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); out_uint16_be(s, 0x1234); out_uint8(s, 0); /* rdpNegData */ if (self->rdpNegData) { if (self->failureCode) { out_uint8(s, RDP_NEG_FAILURE); out_uint8(s, 0); /* no flags */ out_uint16_le(s, 8); /* must be 8 */ out_uint32_le(s, self->failureCode); /* failure code */ } else { out_uint8(s, RDP_NEG_RSP); //TODO: hardcoded flags out_uint8(s, EXTENDED_CLIENT_DATA_SUPPORTED); /* flags */ out_uint16_le(s, 8); /* must be 8 */ out_uint32_le(s, self->selectedProtocol); /* selected protocol */ } } 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; if (trans_write_copy_s(self->trans, s) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_iso_incoming(struct xrdp_iso *self) { int rv = 0; int code; int len; int cookie_index; int cc_type; char text[256]; char *pend; struct stream *s; LLOGLN(10, (" in xrdp_iso_incoming")); s = libxrdp_force_read(self->trans); if (s == 0) { return 1; } if (xrdp_iso_recv_msg(self, s, &code, &len) != 0) { LLOGLN(0, ("xrdp_iso_incoming: xrdp_iso_recv_msg returned non zero")); return 1; } if ((code != ISO_PDU_CR) || (len < 6)) { return 1; } /* process connection request */ pend = s->p + (len - 6); cookie_index = 0; while (s->p < pend) { in_uint8(s, cc_type); switch (cc_type) { default: break; case RDP_NEG_REQ: /* rdpNegReq 1 */ self->rdpNegData = 1; if (xrdp_iso_process_rdp_neg_req(self, s) != 0) { LLOGLN(0, ("xrdp_iso_incoming: xrdp_iso_process_rdpNegReq returned non zero")); return 1; } break; case RDP_CORRELATION_INFO: /* rdpCorrelationInfo 6 */ // TODO in_uint8s(s, 1 + 2 + 16 + 16); break; case 'C': /* Cookie routingToken */ while (s->p < pend) { text[cookie_index] = cc_type; cookie_index++; if (cookie_index > 255) { cookie_index = 255; } if ((s->p[0] == 0x0D) && (s->p[1] == 0x0A)) { in_uint8s(s, 2); text[cookie_index] = 0; cookie_index = 0; if (g_strlen(text) > 0) { } break; } in_uint8(s, cc_type); } break; } } /* negotiate client-server security layer */ rv = xrdp_iso_negotiate_security(self); /* send connection confirm back to client */ if (xrdp_iso_send_cc(self) != 0) { LLOGLN(0, ("xrdp_iso_incoming: xrdp_iso_send_cc returned non zero")); return 1; } LLOGLN(10, (" out xrdp_iso_incoming")); 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; } /*****************************************************************************/ /* returns error */ int xrdp_iso_send(struct xrdp_iso *self, struct stream *s) { int len; LLOGLN(10, (" in xrdp_iso_send")); s_pop_layer(s, iso_hdr); len = (int) (s->end - s->p); out_uint8(s, 3); out_uint8(s, 0); out_uint16_be(s, len); out_uint8(s, 2); out_uint8(s, ISO_PDU_DT); out_uint8(s, 0x80); if (trans_write_copy_s(self->trans, s) != 0) { return 1; } LLOGLN(10, (" out xrdp_iso_send")); return 0; } xrdp-0.9.12/libxrdp/xrdp_channel.c000644 001751 001751 00000055424 13544635323 016777 0ustar00metameta000000 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" /* todo, move these to constants.h */ //#define CHANNEL_CHUNK_LENGTH 1600 /* todo, why is this so small? */ #define CHANNEL_CHUNK_LENGTH 8192 #define CHANNEL_FLAG_FIRST 0x01 #define CHANNEL_FLAG_LAST 0x02 #define CHANNEL_FLAG_SHOW_PROTOCOL 0x10 #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_STATUS_CLOSED 0 #define XRDP_DRDYNVC_STATUS_OPEN_SENT 1 #define XRDP_DRDYNVC_STATUS_OPEN 2 #define XRDP_DRDYNVC_STATUS_CLOSE_SENT 3 /*****************************************************************************/ /* 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) { g_writeln("xrdp_channel_get_item - No channel initialized"); 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) { 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) { g_writeln("xrdp_channel_send - no such channel"); return 1; } if (channel->disabled) { g_writeln("xrdp_channel_send, channel disabled"); 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); if (xrdp_sec_send(self->sec_layer, s, channel->chanid) != 0) { g_writeln("xrdp_channel_send - failure sending data"); 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 { g_writeln("in xrdp_channel_call_callback, session->callback is nil"); } } else { g_writeln("in xrdp_channel_call_callback, session is nil"); } return rv; } /*****************************************************************************/ 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; } /*****************************************************************************/ 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(s, 1)) { return 1; } in_uint8(s, chan_id); } else if (cbChId == 1) { if (!s_check_rem(s, 2)) { return 1; } in_uint16_le(s, chan_id); } else { if (!s_check_rem(s, 4)) { return 1; } in_uint32_le(s, chan_id); } *chan_id_p = chan_id; return 0; } /*****************************************************************************/ static int drdynvc_process_capability_response(struct xrdp_channel *self, int cmd, struct stream *s) { struct xrdp_session *session; int cap_version; int rv; /* skip padding */ in_uint8s(s, 1); /* read client's version */ in_uint16_le(s, cap_version); if ((cap_version != 2) && (cap_version != 3)) { g_writeln("drdynvc_process_capability_response: incompatible DVC " "version %d detected", cap_version); return 1; } g_writeln("drdynvc_process_capability_response: DVC version %d selected", cap_version); self->drdynvc_state = 1; session = self->sec_layer->rdp_layer->session; rv = session->callback(session->id, 0x5558, 0, 0, 0, 0); return rv; } /*****************************************************************************/ 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) { return 1; } if (!s_check_rem(s, 4)) { return 1; } in_uint32_le(s, creation_status); //g_writeln("drdynvc_process_open_channel_response: chan_id 0x%x " // "creation_status %d", chan_id, creation_status); session = self->sec_layer->rdp_layer->session; if (chan_id > 255) { return 1; } drdynvc = self->drdynvcs + chan_id; if (creation_status == 0) { drdynvc->status = XRDP_DRDYNVC_STATUS_OPEN; } else { drdynvc->status = XRDP_DRDYNVC_STATUS_CLOSED; } if (drdynvc->open_response != NULL) { return drdynvc->open_response(session->id, chan_id, creation_status); } return 0; } /*****************************************************************************/ 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) { return 1; } //g_writeln("drdynvc_process_close_channel_response: chan_id 0x%x", chan_id); session = self->sec_layer->rdp_layer->session; if (chan_id > 255) { return 1; } drdynvc = self->drdynvcs + chan_id; drdynvc->status = XRDP_DRDYNVC_STATUS_CLOSED; if (drdynvc->close_response != NULL) { return drdynvc->close_response(session->id, chan_id); } return 0; } /*****************************************************************************/ 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) { return 1; } len = (cmd >> 2) & 0x03; if (len == 0) { if (!s_check_rem(s, 1)) { return 1; } in_uint8(s, total_bytes); } else if (len == 1) { if (!s_check_rem(s, 2)) { return 1; } in_uint16_le(s, total_bytes); } else { if (!s_check_rem(s, 4)) { return 1; } in_uint32_le(s, total_bytes); } bytes = (int) (s->end - s->p); //g_writeln("drdynvc_process_data_first: bytes %d total_bytes %d", bytes, total_bytes); session = self->sec_layer->rdp_layer->session; if (chan_id > 255) { 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); } return 0; } /*****************************************************************************/ 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) { return 1; } bytes = (int) (s->end - s->p); //g_writeln("drdynvc_process_data: bytes %d", bytes); session = self->sec_layer->rdp_layer->session; if (chan_id > 255) { return 1; } drdynvc = self->drdynvcs + chan_id; if (drdynvc->data != NULL) { return drdynvc->data(session->id, chan_id, s->p, bytes); } return 0; } /*****************************************************************************/ 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(s, 8)) { return 1; } in_uint32_le(s, total_length); in_uint32_le(s, flags); //g_writeln("xrdp_channel_process_drdynvc: total_length %d flags 0x%8.8x", // total_length, flags); ls = NULL; switch (flags & 3) { case 0: length = (int) (s->end - s->p); out_uint8a(self->s, s->p, length); in_uint8s(s, length); return 0; case 1: free_stream(self->s); make_stream(self->s); init_stream(self->s, total_length); length = (int) (s->end - s->p); out_uint8a(self->s, s->p, length); in_uint8s(s, length); return 0; case 2: length = (int) (s->end - s->p); out_uint8a(self->s, s->p, length); in_uint8s(s, length); ls = self->s; break; case 3: ls = s; break; default: g_writeln("xrdp_channel_process_drdynvc: error"); return 1; } if (ls == NULL) { return 1; } in_uint8(ls, cmd); /* read command */ //g_writeln("xrdp_channel_process_drdynvc: cmd 0x%x", cmd); 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: g_writeln("xrdp_channel_process_drdynvc: got unknown " "command 0x%x", cmd); break; } //g_writeln("xrdp_channel_process_drdynvc: rv %d", rv); return rv; } /*****************************************************************************/ /* 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) { g_writeln("xrdp_channel_process, channel not found"); return 1; } if (channel->disabled) { g_writeln("xrdp_channel_process, channel disabled"); 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); in_uint32_le(s, flags); rv = xrdp_channel_call_callback(self, s, channel_id, length, flags); return rv; } /*****************************************************************************/ /* drdynvc */ 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) { free_stream(s); return 1; } phold = s->p; out_uint8(s, 0x50); /* insert cmd */ 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 = CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST; channel_id = self->drdynvc_channel_id; if (xrdp_channel_send(self, s, channel_id, total_data_len, flags) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ int xrdp_channel_drdynvc_start(struct xrdp_channel *self) { int index; int count; struct mcs_channel_item *ci; struct mcs_channel_item *dci; g_writeln("xrdp_channel_drdynvc_start:"); 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") == 0) { dci = ci; } } } if (dci != NULL) { self->drdynvc_channel_id = (dci->chanid - MCS_GLOBAL_CHANNEL) - 1; xrdp_channel_drdynvc_send_capability_request(self); } return 0; } /*****************************************************************************/ 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) { free_stream(s); return 1; } cmd_ptr = s->p; out_uint8(s, 0); ChId = 1; while (self->drdynvcs[ChId].status != XRDP_DRDYNVC_STATUS_CLOSED) { ChId++; if (ChId > 255) { free_stream(s); return 1; } } cbChId = drdynvc_insert_uint_124(s, ChId); name_length = g_strlen(name); out_uint8a(s, name, name_length + 1); chan_pri = 0; cmd_ptr[0] = CMD_DVC_OPEN_CHANNEL | ((chan_pri << 2) & 0x0c) | cbChId; static_channel_id = self->drdynvc_channel_id; static_flags = CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST; s_mark_end(s); total_data_len = (int) (s->end - cmd_ptr); if (xrdp_channel_send(self, s, static_channel_id, total_data_len, static_flags) != 0) { 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; } /*****************************************************************************/ 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)) { return 1; } if ((self->drdynvcs[chan_id].status != XRDP_DRDYNVC_STATUS_OPEN) && (self->drdynvcs[chan_id].status != XRDP_DRDYNVC_STATUS_OPEN_SENT)) { /* not open */ return 1; } make_stream(s); init_stream(s, 8192); if (xrdp_channel_init(self, s) != 0) { free_stream(s); return 1; } cmd_ptr = s->p; out_uint8(s, 0); ChId = chan_id; cbChId = drdynvc_insert_uint_124(s, ChId); cmd_ptr[0] = CMD_DVC_CLOSE_CHANNEL | cbChId; static_channel_id = self->drdynvc_channel_id; static_flags = CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST; s_mark_end(s); total_data_len = (int) (s->end - cmd_ptr); if (xrdp_channel_send(self, s, static_channel_id, total_data_len, static_flags) != 0) { free_stream(s); return 1; } free_stream(s); self->drdynvcs[ChId].status = XRDP_DRDYNVC_STATUS_CLOSE_SENT; return 0; } /*****************************************************************************/ 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)) { return 1; } if (self->drdynvcs[chan_id].status != XRDP_DRDYNVC_STATUS_OPEN) { return 1; } if (data_bytes > 1590) { return 1; } make_stream(s); init_stream(s, 8192); if (xrdp_channel_init(self, s) != 0) { free_stream(s); return 1; } cmd_ptr = s->p; out_uint8(s, 0); ChId = chan_id; cbChId = drdynvc_insert_uint_124(s, ChId); cbTotalDataSize = drdynvc_insert_uint_124(s, total_data_bytes); out_uint8p(s, data, data_bytes); cmd_ptr[0] = CMD_DVC_DATA_FIRST | (cbTotalDataSize << 2) | cbChId; static_channel_id = self->drdynvc_channel_id; static_flags = CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST; s_mark_end(s); total_data_len = (int) (s->end - cmd_ptr); if (xrdp_channel_send(self, s, static_channel_id, total_data_len, static_flags) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ 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)) { return 1; } if (self->drdynvcs[chan_id].status != XRDP_DRDYNVC_STATUS_OPEN) { return 1; } if (data_bytes > 1590) { return 1; } make_stream(s); init_stream(s, 8192); if (xrdp_channel_init(self, s) != 0) { free_stream(s); return 1; } cmd_ptr = s->p; out_uint8(s, 0); ChId = chan_id; cbChId = drdynvc_insert_uint_124(s, ChId); out_uint8p(s, data, data_bytes); cmd_ptr[0] = CMD_DVC_DATA | cbChId; static_channel_id = self->drdynvc_channel_id; static_flags = CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST; s_mark_end(s); total_data_len = (int) (s->end - cmd_ptr); if (xrdp_channel_send(self, s, static_channel_id, total_data_len, static_flags) != 0) { free_stream(s); return 1; } free_stream(s); return 0; } xrdp-0.9.12/libxrdp/xrdp_orders_rail.c000644 001751 001751 00000052036 13544635323 017670 0ustar00metameta000000 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 "xrdp_rail.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) { return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ out_uint8(self->out_s, order_flags); /* 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); 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) { return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ out_uint8(self->out_s, order_flags); /* 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); /* CacheEntry (2 bytes) */ out_uint16_le(self->out_s, cache_entry); /* CacheId (1 byte) */ out_uint8(self->out_s, 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); 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) { return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ out_uint8(self->out_s, order_flags); /* 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); 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) { int str_chars; int index; int i32; int len; twchar *wdst; len = g_strlen(text) + 1; wdst = (twchar *) g_malloc(sizeof(twchar) * len, 1); if (wdst == 0) { return 1; } str_chars = g_mbstowcs(wdst, text, len); if (str_chars > 0) { i32 = str_chars * 2; out_uint16_le(s, i32); for (index = 0; index < str_chars; index++) { i32 = wdst[index]; out_uint16_le(s, i32); } } else { out_uint16_le(s, 0); } g_free(wdst); return 0; } /*****************************************************************************/ static int xrdp_orders_get_unicode_bytes(const char *text) { int num_chars; num_chars = g_mbstowcs(0, text, 0); if (num_chars < 0) { /* g_mbstowcs failed, we ignore that text by returning zero bytes */ num_chars = 0; } else { /* calculate the number of bytes of the resulting null-terminated wide-string */ num_chars = (num_chars + 1) * 2; } return num_chars; } /*****************************************************************************/ /* 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) { return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ 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); /* windowId (4 bytes) */ out_uint32_le(self->out_s, window_id); if (field_present_flags & WINDOW_ORDER_FIELD_OWNER) { /* ownerWindowId (4 bytes) */ out_uint32_le(self->out_s, 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); } if (field_present_flags & WINDOW_ORDER_FIELD_SHOW) { /* showState (1 byte) */ out_uint8(self->out_s, 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); } 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); } 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); } if (field_present_flags & WINDOW_ORDER_FIELD_RP_CONTENT) { /* RPContent (1 byte) */ out_uint8(self->out_s, window_state->rp_content); } if (field_present_flags & WINDOW_ORDER_FIELD_ROOT_PARENT) { /* rootParentHandle (4 bytes) */ out_uint32_le(self->out_s, 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); } 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); } 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); } 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); } } 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); } 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); } } 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) { return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ out_uint8(self->out_s, order_flags); /* 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); 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) { return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ 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); /* windowId (4 bytes) */ out_uint32_le(self->out_s, window_id); /* notifyIconId (4 bytes) */ out_uint32_le(self->out_s, notify_id); if (field_present_flags & WINDOW_ORDER_FIELD_NOTIFY_VERSION) { /* Version (4 bytes) */ out_uint32_le(self->out_s, 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); } 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); } if (field_present_flags & WINDOW_ORDER_FIELD_NOTIFY_STATE) { /* State (4 bytes) */ out_uint32_le(self->out_s, 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); } 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) { return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ 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); if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND) { /* ActiveWindowId (4 bytes) */ out_uint32_le(self->out_s, 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]); } } return 0; } xrdp-0.9.12/vnc/Makefile.am000644 001751 001751 00000000705 13544635323 015334 0ustar00metameta000000 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 if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif module_LTLIBRARIES = \ libvnc.la libvnc_la_SOURCES = \ vnc.c \ vnc.h libvnc_la_LIBADD = \ $(top_builddir)/common/libcommon.la if !MACOS libvnc_la_LDFLAGS = -avoid-version -module endif xrdp-0.9.12/vnc/vnc.c000644 001751 001751 00000124237 13544635323 014241 0ustar00metameta000000 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 */ #if defined(HAVE_CONFIG_H) #include #endif #include "vnc.h" #include "log.h" #include "trans.h" #include "ssl_calls.h" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do \ { \ if (_level < LLOG_LEVEL) \ { \ g_write("xrdp:vnc [%10.10u]: ", g_time3()); \ g_writeln _args ; \ } \ } \ while (0) #define AS_LOG_MESSAGE log_message static int lib_mod_process_message(struct vnc *v, struct stream *s); /******************************************************************************/ static 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_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); } /******************************************************************************/ static int lib_process_channel_data(struct vnc *v, int chanid, int flags, int size, struct stream *s, int total_size) { int type; int status; int length; int clip_bytes; int index; int format; struct stream *out_s; if (chanid == v->clip_chanid) { in_uint16_le(s, type); in_uint16_le(s, status); in_uint32_le(s, length); //g_writeln("clip data type %d status %d length %d", type, status, length); //g_hexdump(s->p, s->end - s->p); switch (type) { case 2: /* CLIPRDR_FORMAT_ANNOUNCE */ AS_LOG_MESSAGE(LOG_LEVEL_DEBUG, "CLIPRDR_FORMAT_ANNOUNCE - " "status %d length %d", status, length); make_stream(out_s); init_stream(out_s, 8192); out_uint16_le(out_s, 3); // msg-type: CLIPRDR_FORMAT_ACK out_uint16_le(out_s, 1); // msg-status-code: CLIPRDR_RESPONSE out_uint32_le(out_s, 0); // null (?) out_uint8s(out_s, 4); // pad s_mark_end(out_s); length = (int)(out_s->end - out_s->data); v->server_send_to_channel(v, v->clip_chanid, out_s->data, length, length, 3); free_stream(out_s); #if 0 // Send the CLIPRDR_DATA_REQUEST message to the cliprdr channel. // make_stream(out_s); init_stream(out_s, 8192); out_uint16_le(out_s, 4); // msg-type: CLIPRDR_DATA_REQUEST out_uint16_le(out_s, 0); // msg-status-code: CLIPRDR_REQUEST out_uint32_le(out_s, 4); // sizeof supported-format-list. out_uint32_le(out_s, 1); // supported-format-list: CF_TEXT out_uint8s(out_s, 0); // pad (garbage pad?) s_mark_end(out_s); length = (int)(out_s->end - out_s->data); v->server_send_to_channel(v, v->clip_chanid, out_s->data, length, length, 3); free_stream(out_s); #endif break; case 3: /* CLIPRDR_FORMAT_ACK */ AS_LOG_MESSAGE(LOG_LEVEL_DEBUG, "CLIPRDR_FORMAT_ACK - " "status %d length %d", status, length); break; case 4: /* CLIPRDR_DATA_REQUEST */ AS_LOG_MESSAGE(LOG_LEVEL_DEBUG, "CLIPRDR_DATA_REQUEST - " "status %d length %d", status, length); format = 0; if (length >= 4) { in_uint32_le(s, format); } /* only support CF_TEXT and CF_UNICODETEXT */ if ((format != 1) && (format != 13)) { break; } make_stream(out_s); init_stream(out_s, 8192); out_uint16_le(out_s, 5); out_uint16_le(out_s, 1); if (format == 13) /* CF_UNICODETEXT */ { out_uint32_le(out_s, v->clip_data_s->size * 2 + 2); for (index = 0; index < v->clip_data_s->size; index++) { out_uint8(out_s, v->clip_data_s->data[index]); out_uint8(out_s, 0); } out_uint8s(out_s, 2); } else if (format == 1) /* CF_TEXT */ { out_uint32_le(out_s, v->clip_data_s->size + 1); for (index = 0; index < v->clip_data_s->size; index++) { out_uint8(out_s, v->clip_data_s->data[index]); } out_uint8s(out_s, 1); } out_uint8s(out_s, 4); /* pad */ s_mark_end(out_s); length = (int)(out_s->end - out_s->data); v->server_send_to_channel(v, v->clip_chanid, out_s->data, length, length, 3); free_stream(out_s); break; case 5: /* CLIPRDR_DATA_RESPONSE */ AS_LOG_MESSAGE(LOG_LEVEL_DEBUG, "CLIPRDR_DATA_RESPONSE - " "status %d length %d", status, length); clip_bytes = MIN(length, 256); // - Read the response data from the cliprdr channel, stream 's'. // - Send the response data to the vnc server, stream 'out_s'. // make_stream(out_s); // Send the RFB message type (CLIENT_CUT_TEXT) to the vnc server. init_stream(out_s, clip_bytes + 1 + 3 + 4 + 16); out_uint8(out_s, 6); // RFB msg type: CLIENT_CUT_TEXT out_uint8s(out_s, 3); // padding // Send the length of the cut-text to the vnc server. out_uint32_be(out_s, clip_bytes); // Send the cut-text (as read from 's') to the vnc server. for (index = 0; index < clip_bytes; index++) { char cur_char = '\0'; in_uint8(s, cur_char); // text in from 's' out_uint8(out_s, cur_char); // text out to 'out_s' } s_mark_end(out_s); lib_send_copy(v, out_s); free_stream(out_s); break; default: { log_message(LOG_LEVEL_DEBUG, "VNC clip information unhandled"); break; } } } else { log_message(LOG_LEVEL_DEBUG, "lib_process_channel_data: unknown chanid: " "%d :(v->clip_chanid) %d", chanid, v->clip_chanid); } return 0; } /******************************************************************************/ 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 == 0x5555) /* 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)) { init_stream(s, size); out_uint8a(s, data, size); s_mark_end(s); s->p = s->data; error = lib_process_channel_data(v, chanid, flags, size, s, total_size); } 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, 4); 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, 4); 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; } } } else if (msg >= 100 && msg <= 110) /* mouse events */ { switch (msg) { case 100: break; /* WM_MOUSEMOVE */ case 101: v->mod_mouse_state &= ~1; break; /* WM_LBUTTONUP */ case 102: v->mod_mouse_state |= 1; break; /* WM_LBUTTONDOWN */ case 103: v->mod_mouse_state &= ~4; break; /* WM_RBUTTONUP */ case 104: v->mod_mouse_state |= 4; break; /* WM_RBUTTONDOWN */ case 105: v->mod_mouse_state &= ~2; break; case 106: v->mod_mouse_state |= 2; break; case 107: v->mod_mouse_state &= ~8; break; case 108: v->mod_mouse_state |= 8; break; case 109: v->mod_mouse_state &= ~16; break; case 110: v->mod_mouse_state |= 16; break; } init_stream(s, 8192); out_uint8(s, 5); 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) { /* FramebufferUpdateRequest */ init_stream(s, 8192); out_uint8(s, 3); out_uint8(s, 0); 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_message(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_message(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_message(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_message(LOG_LEVEL_ERROR, "error in make_color bpp %d", bpp); } return 0; } /******************************************************************************/ 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 Bpp; int pixel; int r; int g; int b; int error; int need_size; struct stream *s; struct stream *pixel_s; num_recs = 0; Bpp = (v->mod_bpp + 7) / 8; if (Bpp == 3) { Bpp = 4; } 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 == 0) /* raw */ { need_size = cx * cy * 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 == 1) /* 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 == 0xffffff11) /* cursor */ { g_memset(cursor_data, 0, 32 * (32 * 3)); g_memset(cursor_mask, 0, 32 * (32 / 8)); j = cx * cy * 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->mod_bpp); split_color(pixel, &r, &g, &b, v->mod_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 == 0xffffff21) /* desktop size */ { v->mod_width = cx; v->mod_height = cy; error = v->server_reset(v, cx, cy, v->mod_bpp); } 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) { /* FramebufferUpdateRequest */ init_stream(s, 8192); out_uint8(s, 3); out_uint8(s, 1); out_uint16_be(s, 0); out_uint16_be(s, 0); out_uint16_be(s, v->mod_width); out_uint16_be(s, v->mod_height); s_mark_end(s); error = lib_send_copy(v, s); } } free_stream(s); free_stream(pixel_s); return error; } /******************************************************************************/ /* clip data from the vnc server */ int lib_clip_data(struct vnc *v) { struct stream *s; struct stream *out_s; int size; int error; free_stream(v->clip_data_s); v->clip_data_s = 0; make_stream(s); init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 7); if (error == 0) { in_uint8s(s, 3); in_uint32_be(s, size); make_stream(v->clip_data_s); init_stream(v->clip_data_s, size); error = trans_force_read_s(v->trans, v->clip_data_s, size); } if (error == 0) { make_stream(out_s); init_stream(out_s, 8192); out_uint16_le(out_s, 2); out_uint16_le(out_s, 0); out_uint32_le(out_s, 0x90); out_uint8(out_s, 0x0d); out_uint8s(out_s, 35); out_uint8(out_s, 0x10); out_uint8s(out_s, 35); out_uint8(out_s, 0x01); out_uint8s(out_s, 35); out_uint8(out_s, 0x07); out_uint8s(out_s, 35); out_uint8s(out_s, 4); s_mark_end(out_s); size = (int)(out_s->end - out_s->data); error = v->server_send_to_channel(v, v->clip_chanid, out_s->data, size, size, 3); free_stream(out_s); } free_stream(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) { g_writeln("lib_mod_signal: not used"); 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 == 0) /* framebuffer update */ { error = lib_framebuffer_update(v); } else if (type == 1) /* palette */ { error = lib_palette_update(v); } else if (type == 2) /* bell */ { error = lib_bell_trigger(v); } else if (type == 3) /* clipboard */ { log_message(LOG_LEVEL_DEBUG, "VNC got clip data"); error = lib_clip_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_width = w; v->server_height = h; v->server_bpp = bpp; return 0; } /******************************************************************************/ static int lib_open_clip_channel(struct vnc *v) { char init_data[12] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; v->clip_chanid = v->server_get_channel_id(v, "cliprdr"); if (v->clip_chanid >= 0) { v->server_send_to_channel(v, v->clip_chanid, init_data, 12, 12, 3); } return 0; } /******************************************************************************/ static int lib_data_in(struct trans *trans) { struct vnc *self; struct stream *s; LLOGLN(10, ("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) { g_writeln("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; struct source_info *si; 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); si = (struct source_info *) (v->si); v->trans->si = 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 (v->got_guid) { char guid_str[64]; g_bytes_to_hexstr(v->guid, 16, guid_str, 64); 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_message(LOG_LEVEL_DEBUG, "VNC Server will disconnect"); error = 1; } else { log_message(LOG_LEVEL_DEBUG, "VNC unsupported security level"); error = 1; } } } if (error != 0) { log_message(LOG_LEVEL_DEBUG, "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_message(LOG_LEVEL_DEBUG, "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_message(LOG_LEVEL_DEBUG, "VNC error before receiving server init"); } if (error == 0) { in_uint16_be(s, v->mod_width); in_uint16_be(s, v->mod_height); 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_message(LOG_LEVEL_DEBUG, "VNC error before receiving pixel format"); } if (error == 0) { v->mod_bpp = v->server_bpp; 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_message(LOG_LEVEL_DEBUG, "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_message(LOG_LEVEL_DEBUG, "VNC error before receiving name"); } /* should be connected */ if (error == 0) { /* SetPixelFormat */ init_stream(s, 8192); out_uint8(s, 0); out_uint8(s, 0); out_uint8(s, 0); out_uint8(s, 0); init_stream(pixel_format, 8192); if (v->mod_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->mod_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->mod_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->mod_bpp == 24 || v->mod_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) { /* SetEncodings */ init_stream(s, 8192); out_uint8(s, 2); out_uint8(s, 0); out_uint16_be(s, 4); out_uint32_be(s, 0); /* raw */ out_uint32_be(s, 1); /* copy rect */ out_uint32_be(s, 0xffffff11); /* cursor */ out_uint32_be(s, 0xffffff21); /* desktop size */ v->server_msg(v, "VNC sending encodings", 0); s_mark_end(s); error = trans_force_write_s(v->trans, s); } if (error == 0) { error = v->server_reset(v, v->mod_width, v->mod_height, v->mod_bpp); } if (error == 0) { if (v->suppress_output == 0) { /* FramebufferUpdateRequest */ init_stream(s, 8192); out_uint8(s, 3); out_uint8(s, 0); out_uint16_be(s, 0); out_uint16_be(s, 0); out_uint16_be(s, v->mod_width); out_uint16_be(s, v->mod_height); v->server_msg(v, "VNC sending framebuffer update request", 0); s_mark_end(s); error = trans_force_write_s(v->trans, s); } } if (error == 0) { if (v->server_bpp != v->mod_bpp) { v->server_msg(v, "VNC error - server bpp and client bpp do not match", 0); error = 1; } } 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); lib_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) { } free_stream(v->clip_data_s); return 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->got_guid = 1; g_memcpy(v->guid, value, 16); } 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) { LLOGLN(10, ("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); } } 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) { /* FramebufferUpdateRequest */ make_stream(s); init_stream(s, 8192); out_uint8(s, 3); out_uint8(s, 0); out_uint16_be(s, 0); out_uint16_be(s, 0); out_uint16_be(s, v->mod_width); out_uint16_be(s, v->mod_height); s_mark_end(s); error = lib_send_copy(v, s); free_stream(s); } return error; } /******************************************************************************/ 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; return (tintptr) v; } /******************************************************************************/ int EXPORT_CC mod_exit(tintptr handle) { struct vnc *v = (struct vnc *) handle; log_message(LOG_LEVEL_DEBUG, "VNC mod_exit"); if (v == 0) { return 0; } trans_delete(v->trans); g_free(v); return 0; } xrdp-0.9.12/vnc/Makefile.in000644 001751 001751 00000052574 13601646126 015355 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libvnc_la_DEPENDENCIES = $(top_builddir)/common/libcommon.la am_libvnc_la_OBJECTS = vnc.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)/vnc.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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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__append_1) module_LTLIBRARIES = \ libvnc.la libvnc_la_SOURCES = \ vnc.c \ vnc.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: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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)/vnc.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/vnc.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)/vnc.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: xrdp-0.9.12/vnc/vnc.h000644 001751 001751 00000011541 13544635323 014237 0ustar00metameta000000 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 */ /* include other h files */ #include "arch.h" #include "parse.h" #include "os_calls.h" #include "defines.h" #define CURRENT_MOD_VER 4 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); tintptr mod_dumby[100 - 11]; /* 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)(struct vnc* v); 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 (*server_reset)(struct vnc* v, int width, int height, int bpp); 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); tintptr server_dumby[100 - 25]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as long */ tintptr wm; tintptr painter; tintptr si; /* mod data */ int server_width; int server_height; int server_bpp; int mod_width; int mod_height; int mod_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 stream *clip_data_s; int delay_ms; struct trans *trans; int got_guid; tui8 guid[16]; int suppress_output; }; xrdp-0.9.12/common/defines.h000644 001751 001751 00000007060 13544635323 015571 0ustar00metameta000000 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 /* check for debug */ #ifdef XRDP_DEBUG #define DEBUG(args) g_writeln args; #define LIB_DEBUG(_mod, _text) _mod->server_msg(_mod, _text, 1); #else #define DEBUG(args) #define LIB_DEBUG(_mod, _text) #endif /* 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 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(f) \ ((((f)->height * (((f)->width + 7) / 8)) + 3) & ~3); /* 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.9.12/common/xrdp_rail.h000644 001751 001751 00000011114 13544635323 016133 0ustar00metameta000000 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.9.12/common/pixman-region.h000644 001751 001751 00000005510 13544635323 016727 0ustar00metameta000000 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 */ #if !defined(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); #endif xrdp-0.9.12/common/pixman-region16.c000644 001751 001751 00000004423 13544635323 017073 0ustar00metameta000000 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.9.12/common/arch.h000644 001751 001751 00000007345 13544635323 015077 0ustar00metameta000000 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 #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; /* 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(__hppa__) || \ (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(__mips__) || \ defined(__ia64__) || defined(__arm__) || \ (defined(__PPC__) && defined(__BIG_ENDIAN__)) || \ (defined(__ppc__) && defined(__BIG_ENDIAN__)) #define NEED_ALIGN #elif defined(__x86__) || defined(__x86_64__) || \ defined(__AMD64__) || defined(_M_IX86) || defined (_M_AMD64) || \ defined(__i386__) || defined(__aarch64__) #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; /* wide char, socket */ #if defined(_WIN32) typedef unsigned short twchar; typedef unsigned int tsock; #else typedef int twchar; 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.9.12/common/file.c000644 001751 001751 00000022733 13544635323 015072 0ustar00metameta000000 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 "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_item(names, (tbus)g_strdup(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_item(names, (tbus)g_strdup(name)); if (value[0] == '$') { lvalue = g_getenv(value + 1); if (lvalue != 0) { list_add_item(values, (tbus)g_strdup(lvalue)); } else { list_add_item(values, (tbus)g_strdup("")); } } else { list_add_item(values, (tbus)g_strdup(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_ex(file_name, 1, 0, 0, 0); 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_ex(file_name, 1, 0, 0, 0); if (fd < 0) { return 1; } rv = l_file_read_section(fd, file_size, section, names, values); g_file_close(fd); return rv; } xrdp-0.9.12/common/ssl_calls.c000644 001751 001751 00000066652 13544635323 016142 0ustar00metameta000000 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 "arch.h" #include "ssl_calls.h" #include "trans.h" #include "log.h" #define SSL_WANT_READ_WRITE_TIMEOUT 100 #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 */ /*****************************************************************************/ int ssl_init(void) { SSL_load_error_strings(); SSL_library_init(); return 0; } /*****************************************************************************/ int ssl_finish(void) { return 0; } /* rc4 stuff */ /*****************************************************************************/ void * ssl_rc4_info_create(void) { return g_malloc(sizeof(RC4_KEY), 1); } /*****************************************************************************/ void ssl_rc4_info_delete(void *rc4_info) { g_free(rc4_info); } /*****************************************************************************/ void ssl_rc4_set_key(void *rc4_info, char *key, int len) { RC4_set_key((RC4_KEY *)rc4_info, len, (tui8 *)key); } /*****************************************************************************/ void ssl_rc4_crypt(void *rc4_info, char *data, int len) { RC4((RC4_KEY *)rc4_info, len, (tui8 *)data, (tui8 *)data); } /* sha1 stuff */ /*****************************************************************************/ void * ssl_sha1_info_create(void) { return g_malloc(sizeof(SHA_CTX), 1); } /*****************************************************************************/ void ssl_sha1_info_delete(void *sha1_info) { g_free(sha1_info); } /*****************************************************************************/ void ssl_sha1_clear(void *sha1_info) { SHA1_Init((SHA_CTX *)sha1_info); } /*****************************************************************************/ void ssl_sha1_transform(void *sha1_info, const char *data, int len) { SHA1_Update((SHA_CTX *)sha1_info, data, len); } /*****************************************************************************/ void ssl_sha1_complete(void *sha1_info, char *data) { SHA1_Final((tui8 *)data, (SHA_CTX *)sha1_info); } /* md5 stuff */ /*****************************************************************************/ void * ssl_md5_info_create(void) { return g_malloc(sizeof(MD5_CTX), 1); } /*****************************************************************************/ void ssl_md5_info_delete(void *md5_info) { g_free(md5_info); } /*****************************************************************************/ void ssl_md5_clear(void *md5_info) { MD5_Init((MD5_CTX *)md5_info); } /*****************************************************************************/ void ssl_md5_transform(void *md5_info, char *data, int len) { MD5_Update((MD5_CTX *)md5_info, data, len); } /*****************************************************************************/ void ssl_md5_complete(void *md5_info, char *data) { MD5_Final((tui8 *)data, (MD5_CTX *)md5_info); } /* 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; des3_ctx = EVP_CIPHER_CTX_new(); lkey = (const tui8 *) key; livec = (const tui8 *) ivec; EVP_EncryptInit_ex(des3_ctx, EVP_des_ede3_cbc(), NULL, lkey, livec); 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; des3_ctx = EVP_CIPHER_CTX_new(); lkey = (const tui8 *) key; livec = (const tui8 *) ivec; EVP_DecryptInit_ex(des3_ctx, EVP_des_ede3_cbc(), NULL, lkey, livec); 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; 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; 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) { HMAC_CTX *hmac_ctx; hmac_ctx = HMAC_CTX_new(); return hmac_ctx; } /*****************************************************************************/ void ssl_hmac_info_delete(void *hmac) { HMAC_CTX *hmac_ctx; hmac_ctx = (HMAC_CTX *) hmac; if (hmac_ctx != 0) { HMAC_CTX_free(hmac_ctx); } } /*****************************************************************************/ void ssl_hmac_sha1_init(void *hmac, const char *data, int len) { HMAC_CTX *hmac_ctx; hmac_ctx = (HMAC_CTX *) hmac; HMAC_Init_ex(hmac_ctx, data, len, EVP_sha1(), NULL); } /*****************************************************************************/ void ssl_hmac_transform(void *hmac, const char *data, int len) { HMAC_CTX *hmac_ctx; const tui8 *ldata; hmac_ctx = (HMAC_CTX *) hmac; ldata = (const tui8*) data; HMAC_Update(hmac_ctx, ldata, len); } /*****************************************************************************/ void ssl_hmac_complete(void *hmac, char *data, int len) { HMAC_CTX *hmac_ctx; tui8* ldata; tui32 llen; hmac_ctx = (HMAC_CTX *) hmac; ldata = (tui8 *) data; llen = len; HMAC_Final(hmac_ctx, ldata, &llen); } /*****************************************************************************/ 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; RSA *my_key; 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); my_key = RSA_new(); error = RSA_generate_key_ex(my_key, key_size_in_bits, my_e, 0) == 0; const BIGNUM *n; const BIGNUM *d; RSA_get0_key(my_key, &n, NULL, &d); 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); RSA_free(my_key); 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) */ 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; } /*****************************************************************************/ 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; } /*****************************************************************************/ int ssl_tls_print_error(const char *func, SSL *connection, int value) { switch (SSL_get_error(connection, value)) { case SSL_ERROR_ZERO_RETURN: g_writeln("ssl_tls_print_error: %s: Server closed TLS connection", func); return 1; case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: return 0; case SSL_ERROR_SYSCALL: g_writeln("ssl_tls_print_error: %s: I/O error", func); return 1; case SSL_ERROR_SSL: g_writeln("ssl_tls_print_error: %s: Failure in SSL library (protocol error?)", func); return 1; default: g_writeln("ssl_tls_print_error: %s: Unknown error", func); return 1; } } /*****************************************************************************/ int ssl_tls_accept(struct ssl_tls *self, long ssl_protocols, const char *tls_ciphers) { int connection_status; long options = 0; /** * 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_message(LOG_LEVEL_ERROR, "ssl_tls_accept: SSL_CTX_new failed"); 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 */ DH *dh = ssl_get_dh2236(); if (dh == NULL) { log_message(LOG_LEVEL_ERROR, "ssl_tls_accept: ssl_get_dh2236 failed"); return 1; } if (SSL_CTX_set_tmp_dh(self->ctx, dh) != 1) { log_message(LOG_LEVEL_ERROR, "ssl_tls_accept: SSL_CTX_set_tmp_dh failed"); return 1; } DH_free(dh); // ok to free, copied into ctx by SSL_CTX_set_tmp_dh() #if defined(SSL_CTX_set_ecdh_auto) SSL_CTX_set_ecdh_auto(self->ctx, 1); #endif if (g_strlen(tls_ciphers) > 1) { log_message(LOG_LEVEL_TRACE, "ssl_tls_accept: tls_ciphers=%s", tls_ciphers); if (SSL_CTX_set_cipher_list(self->ctx, tls_ciphers) == 0) { g_writeln("ssl_tls_accept: invalid cipher options"); return 1; } } SSL_CTX_set_read_ahead(self->ctx, 0); if (SSL_CTX_use_RSAPrivateKey_file(self->ctx, self->key, SSL_FILETYPE_PEM) <= 0) { g_writeln("ssl_tls_accept: SSL_CTX_use_RSAPrivateKey_file failed"); return 1; } if (SSL_CTX_use_certificate_chain_file(self->ctx, self->cert) <= 0) { g_writeln("ssl_tls_accept: SSL_CTX_use_certificate_chain_file failed"); return 1; } self->ssl = SSL_new(self->ctx); if (self->ssl == NULL) { g_writeln("ssl_tls_accept: SSL_new failed"); return 1; } if (SSL_set_fd(self->ssl, self->trans->sck) < 1) { g_writeln("ssl_tls_accept: SSL_set_fd failed"); return 1; } while(1) { connection_status = SSL_accept(self->ssl); if (connection_status <= 0) { if (ssl_tls_print_error("SSL_accept", self->ssl, 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; } } g_writeln("ssl_tls_accept: 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_print_error("SSL_shutdown", self->ssl, 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_print_error("SSL_read", tls->ssl, 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_print_error("SSL_write", tls->ssl, 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_st *ssl) { return SSL_get_version(ssl); } /*****************************************************************************/ const char * ssl_get_cipher_name(const struct ssl_st *ssl) { return SSL_get_cipher_name(ssl); } /*****************************************************************************/ 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_message(LOG_LEVEL_DEBUG, "TLSv1.3 enabled"); protocols &= ~SSL_OP_NO_TLSv1_3; #else log_message(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_message(LOG_LEVEL_DEBUG, "TLSv1.2 enabled"); protocols &= ~SSL_OP_NO_TLSv1_2; #else log_message(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_message(LOG_LEVEL_DEBUG, "TLSv1.1 enabled"); protocols &= ~SSL_OP_NO_TLSv1_1; #else log_message(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_message(LOG_LEVEL_DEBUG, "TLSv1 enabled"); protocols &= ~SSL_OP_NO_TLSv1; #else log_message(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_message(LOG_LEVEL_DEBUG, "SSLv3 enabled"); protocols &= ~SSL_OP_NO_SSLv3; #else log_message(LOG_LEVEL_WARNING, "SSLv3 enabled by config, " "but not supported by system OpenSSL"); rv |= (1 << 4); #endif } if (protocols == bad_protocols) { log_message(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.9.12/common/Makefile.in000644 001751 001751 00000062172 13601646125 016051 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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 list.c list.h list16.c list16.h \ log.c log.h os_calls.c os_calls.h parse.h rail.h ssl_calls.c \ ssl_calls.h thread_calls.c thread_calls.h trans.c trans.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 list.lo list16.lo \ log.lo os_calls.lo ssl_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)/list.Plo \ ./$(DEPDIR)/list16.Plo ./$(DEPDIR)/log.Plo \ ./$(DEPDIR)/os_calls.Plo ./$(DEPDIR)/pixman-region16.Plo \ ./$(DEPDIR)/ssl_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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 = \ 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\" \ -DXRDP_SOCKET_PATH=\"${socketdir}\" $(am__append_1) AM_CFLAGS = $(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 \ list.c \ list.h \ list16.c \ list16.h \ log.c \ log.h \ os_calls.c \ os_calls.h \ os_calls.h \ parse.h \ rail.h \ ssl_calls.c \ ssl_calls.h \ thread_calls.c \ thread_calls.h \ trans.c \ trans.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: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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)/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)/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)/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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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)/list.Plo -rm -f ./$(DEPDIR)/list16.Plo -rm -f ./$(DEPDIR)/log.Plo -rm -f ./$(DEPDIR)/os_calls.Plo -rm -f ./$(DEPDIR)/pixman-region16.Plo -rm -f ./$(DEPDIR)/ssl_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)/list.Plo -rm -f ./$(DEPDIR)/list16.Plo -rm -f ./$(DEPDIR)/log.Plo -rm -f ./$(DEPDIR)/os_calls.Plo -rm -f ./$(DEPDIR)/pixman-region16.Plo -rm -f ./$(DEPDIR)/ssl_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: xrdp-0.9.12/common/trans.h000644 001751 001751 00000007761 13544635323 015313 0ustar00metameta000000 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 */ #define XRDP_SOURCE_NONE 0 #define XRDP_SOURCE_CLIENT 1 #define XRDP_SOURCE_SESMAN 2 #define XRDP_SOURCE_CHANSRV 3 #define XRDP_SOURCE_MOD 4 struct source_info { int cur_source; int source[7]; }; 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; 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; char addr[256]; char port[256]; int no_stream_init_on_data_in; int extra_flags; /* 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; int 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); int trans_connect(struct trans* self, const char* server, const char* port, int timeout); int trans_listen_address(struct trans* self, char* port, const char* address); int trans_listen(struct trans* self, 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.9.12/common/os_calls.h000644 001751 001751 00000020742 13544635323 015755 0ustar00metameta000000 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" #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); int g_mk_socket_path(const char* app_name); void g_init(const char* app_name); void g_deinit(void); void* g_malloc(int size, int zero); void g_free(void* ptr); 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); void g_memset(void* ptr, int val, int size); void g_memcpy(void* d_ptr, const void* s_ptr, int size); 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_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_tcp_accept(int sck); int g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes); int g_sck_recv(int sck, void* ptr, int len, int flags); int g_sck_send(int sck, const void* ptr, int len, int flags); int g_sck_last_error_would_block(int sck); int g_sck_socket_ok(int sck); int g_sck_can_send(int sck, int millis); int g_sck_can_recv(int sck, int millis); int g_sck_select(int sck1, int sck2); void g_write_ip_address(int rcv_sck, char* ip_address, int bytes); void g_sleep(int msecs); 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); 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(const char* file_name); int g_file_open_ex(const char *file_name, int aread, int awrite, int acreate, int atrunc); int g_file_close(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_chmod_hex(const char* filename, 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_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_strlen(const char* text); const char *g_strchr(const char *text, int c); 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_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); 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); int g_mbstowcs(twchar* dest, const char* src, int n); int g_wcstombs(char* dest, const twchar* src, int n); int g_strtrim(char* str, int trim_flags); 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(char* aexec); char* g_get_strerror(void); int g_get_errno(void); int g_execvp(const char* p1, char* args[]); int g_execlp3(const char* a1, const char* a2, const char* a3); void g_signal_child_stop(void (*func)(int)); void g_signal_segfault(void (*func)(int)); void g_signal_hang_up(void (*func)(int)); void g_signal_user_interrupt(void (*func)(int)); void g_signal_terminate(void (*func)(int)); void g_signal_pipe(void (*func)(int)); void g_signal_usr1(void (*func)(int)); int g_fork(void); int g_setgid(int pid); int g_initgroups(const char* user, int gid); int g_getuid(void); int g_getgid(void); int g_setuid(int pid); int g_setsid(void); int g_setlogin(const char *name); int g_waitchild(void); int g_waitpid(int pid); 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_getuser_info(const char* username, int* gid, int* uid, char** shell, char** dir, char** gecos); int g_getgroup_info(const char* groupname, int* gid); 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); int g_text2bool(const char *s); 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); /* 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)) #endif xrdp-0.9.12/common/base64.c000644 001751 001751 00000003543 13544635323 015235 0ustar00metameta000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Koichiro Iwao 2017 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Base64 encoder / decoder */ #if defined(HAVE_CONFIG_H) #include #endif #include "os_calls.h" #include #include size_t base64_decoded_bytes(const char *src) { size_t len; size_t padding; len = g_strlen(src); padding = 0; if (src[len - 1] == '=') { padding++; if (src[len - 2] == '=') { padding++; } } return len * 3 / 4 - padding; } /*****************************************************************************/ char * base64_decode(char *dst, const char *src, size_t len) { BIO *b64; BIO *bio; char *b64str; size_t estimated_decoded_bytes; size_t decoded_bytes; b64str = g_strdup(src); estimated_decoded_bytes = base64_decoded_bytes(b64str); dst[estimated_decoded_bytes] = '\0'; b64 = BIO_new(BIO_f_base64()); bio = BIO_new_mem_buf(b64str, len); bio = BIO_push(b64, bio); BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL); decoded_bytes = BIO_read(bio , dst, len); BIO_free_all(bio); /* if input is corrupt, return empty string */ if (estimated_decoded_bytes != decoded_bytes) { g_strncpy(dst, "", sizeof("")); } return dst; } xrdp-0.9.12/common/log.h000644 001751 001751 00000010574 13544635323 014741 0ustar00metameta000000 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" /* logging buffer size */ #define LOG_BUFFER_SIZE 1024 /* logging levels */ enum logLevels { LOG_LEVEL_ALWAYS = 0, LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_TRACE }; /* 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_LOG_FILE "LogFile" #define SESMAN_CFG_LOG_LEVEL "LogLevel" #define SESMAN_CFG_LOG_ENABLE_SYSLOG "EnableSyslog" #define SESMAN_CFG_LOG_SYSLOG_LEVEL "SyslogLevel" /* enable threading */ /*#define LOG_ENABLE_THREAD*/ #ifdef XRDP_DEBUG #define LOG_DBG(args...) log_message(LOG_LEVEL_DEBUG, args); #else #define LOG_DBG(args...) #endif struct log_config { const char *program_name; char *log_file; int fd; enum logLevels log_level; int enable_syslog; enum logLevels syslog_level; pthread_mutex_t log_lock; pthread_mutexattr_t log_lock_attr; }; /* 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 *s); /** * A function that init our struct that holds all state and * also init its content. * @return LOG_STARTUP_OK or LOG_ERROR_MALLOC */ enum logReturns internalInitAndAllocStruct(void); /** * Read configuration from a file and store the values in lists. * @param file * @param lc * @param param_n * @param param_v * @param applicationName, the application name used in the log events. * @return */ enum logReturns internal_config_read_logging(int file, struct log_config *lc, struct list *param_n, struct list *param_v, const char *applicationName); /*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 * @return LOG_STARTUP_OK on success */ enum logReturns log_start(const char *iniFile, const char *applicationName); /** * An alternative log_start where the caller gives the params directly. * @param iniParams * @return */ enum logReturns log_start_from_param(const struct log_config *iniParams); /** * Function that terminates all logging * @return */ enum logReturns log_end(void); /** * the log function that all files use to log an event. * @param lvl, the loglevel * @param msg, the logtext. * @param ... * @return */ enum logReturns log_message(const enum logLevels lvl, const char *msg, ...) printflike(2, 3); /** * 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); #endif xrdp-0.9.12/common/list16.h000644 001751 001751 00000002446 13544635323 015301 0ustar00metameta000000 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.9.12/common/list.h000644 001751 001751 00000002526 13544635323 015131 0ustar00metameta000000 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); void list_delete(struct list* self); void 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); void list_insert_item(struct list* self, int index, tintptr item); void list_append_list_strdup(struct list* self, struct list* dest, int start_index); void list_dump_items(struct list* self); #endif xrdp-0.9.12/common/fifo.h000644 001751 001751 00000002202 13544635323 015070 0ustar00metameta000000 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. * * FIFO implementation to store pointer to data struct */ #ifndef _FIFO_H #define _FIFO_H #include "arch.h" typedef struct user_data USER_DATA; struct user_data { USER_DATA *next; void *item; }; typedef struct fifo { USER_DATA *head; USER_DATA *tail; int auto_free; } FIFO; FIFO * fifo_create(void); void fifo_delete(FIFO *self); int fifo_add_item(FIFO *self, void *item); void * fifo_remove_item(FIFO *self); int fifo_is_empty(FIFO *self); #endif xrdp-0.9.12/common/thread_calls.h000644 001751 001751 00000002170 13544635323 016576 0ustar00metameta000000 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.9.12/common/Makefile.am000644 001751 001751 00000002042 13544635323 016032 0ustar00metameta000000 000000 if XRDP_PIXMAN PIXMAN_SOURCES = else PIXMAN_SOURCES = pixman-region16.c pixman-region.h endif EXTRA_DIST = pixman-region.c include_HEADERS = \ 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\" \ -DXRDP_SOCKET_PATH=\"${socketdir}\" if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif AM_CFLAGS = $(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 \ list.c \ list.h \ list16.c \ list16.h \ log.c \ log.h \ os_calls.c \ os_calls.h \ os_calls.h \ parse.h \ rail.h \ ssl_calls.c \ ssl_calls.h \ thread_calls.c \ thread_calls.h \ trans.c \ trans.h \ $(PIXMAN_SOURCES) libcommon_la_LIBADD = \ -lpthread \ $(OPENSSL_LIBS) \ $(DLOPEN_LIBS) xrdp-0.9.12/common/trans.c000644 001751 001751 00000061704 13544635323 015303 0ustar00metameta000000 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 "trans.h" #include "arch.h" #include "parse.h" #include "ssl_calls.h" #define MAX_SBYTES 0 /*****************************************************************************/ 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) { 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; } free_stream(self->in_s); free_stream(self->out_s); if (self->sck > 0) { g_tcp_close(self->sck); } self->sck = 0; 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 != 0) { if (self->tls->rwo != 0) { objs[*count] = self->tls->rwo; (*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; int to_read = 0; int read_so_far = 0; int rv = 0; int 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, self->addr, sizeof(self->addr), self->port, sizeof(self->port)); 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_strncpy(in_trans->addr, self->addr, sizeof(self->addr) - 1); g_strncpy(in_trans->port, self->port, sizeof(self->port) - 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)) { cur_source = 0; if (self->si != 0) { cur_source = self->si->cur_source; self->si->cur_source = self->my_source; } read_so_far = (int) (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 = (int) (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) { return 1; } while (size > 0) { /* make sure stream has room */ if ((in_s->end + size) > (in_s->data + in_s->size)) { return 1; } 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 != 0) && (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); } /*****************************************************************************/ int trans_connect(struct trans *self, const char *server, const char *port, int timeout) { int error; int now; int start_time; start_time = g_time3(); if (self->sck != 0) { g_tcp_close(self->sck); self->sck = 0; } if (self->mode == TRANS_MODE_TCP) /* tcp */ { self->sck = g_tcp_socket(); if (self->sck < 0) { self->status = TRANS_STATUS_DOWN; return 1; } g_tcp_set_non_blocking(self->sck); while (1) { error = g_tcp_connect(self->sck, server, port); if (error == 0) { break; } else { if (timeout < 1) { self->status = TRANS_STATUS_DOWN; return 1; } now = g_time3(); if (now - start_time < timeout) { g_sleep(100); } else { self->status = TRANS_STATUS_DOWN; return 1; } if (self->is_term != NULL) { if (self->is_term()) { self->status = TRANS_STATUS_DOWN; return 1; } } } } } else if (self->mode == TRANS_MODE_UNIX) /* unix socket */ { self->sck = g_tcp_local_socket(); if (self->sck < 0) { self->status = TRANS_STATUS_DOWN; return 1; } g_tcp_set_non_blocking(self->sck); while (1) { error = g_tcp_local_connect(self->sck, port); if (error == 0) { break; } else { if (timeout < 1) { self->status = TRANS_STATUS_DOWN; return 1; } now = g_time3(); if (now - start_time < timeout) { g_sleep(100); } else { self->status = TRANS_STATUS_DOWN; return 1; } if (self->is_term != NULL) { if (self->is_term()) { self->status = TRANS_STATUS_DOWN; return 1; } } } } } else { self->status = TRANS_STATUS_DOWN; return 1; } if (error == -1) { if (g_tcp_last_error_would_block(self->sck)) { now = g_time3(); if (now - start_time < timeout) { timeout = timeout - (now - start_time); } else { timeout = 0; } if (g_tcp_can_send(self->sck, timeout)) { self->status = TRANS_STATUS_UP; /* ok */ self->type1 = TRANS_TYPE_CLIENT; /* client */ return 0; } } return 1; } self->status = TRANS_STATUS_UP; /* ok */ self->type1 = TRANS_TYPE_CLIENT; /* client */ return 0; } /*****************************************************************************/ /** * @return 0 on success, 1 on failure */ int trans_listen_address(struct trans *self, 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_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_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_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_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_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, 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) { g_writeln("trans_set_tls_mode: ssl_tls_create malloc error"); return 1; } if (ssl_tls_accept(self->tls, ssl_protocols, tls_ciphers) != 0) { g_writeln("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->ssl); self->cipher_name = ssl_get_cipher_name(self->tls->ssl); 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.9.12/common/rail.h000644 001751 001751 00000010750 13544635323 015103 0ustar00metameta000000 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.9.12/common/xrdp_constants.h000644 001751 001751 00000100100 13601643631 017205 0ustar00metameta000000 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 * ******************************************************************************/ #define INFO_CLIENT_NAME_BYTES 32 #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 Remote Desktop Protocol */ /* 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 (MS-RDPBCGR 2.2.1.1.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 (MS-RDPBCGR 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 (MS-RDPBCGR 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 /* Client Core Data: connectionType (MS-RDPBCGR 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 /* Client Core Data: colorDepth, postBeta2ColorDepth (MS-RDPBCGR 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 /* Slow-Path Input Event: messageType (MS-RDPBCGR 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 #define FASTPATH_INPUT_ENCRYPTED 0x2 /* Fast-Path Input Event: eventCode (MS-RDPBCGR 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 (MS-RDPBCGR 2.2.8.2.2.1) */ #define FASTPATH_INPUT_KBDFLAGS_RELEASE 0x01 #define FASTPATH_INPUT_KBDFLAGS_EXTENDED 0x02 #define FASTPATH_INPUT_KBDFLAGS_EXTENDED1 0x04 /* Server Fast-Path Update PDU: action (MS-RDPBCGR 2.2.0.1.2) */ #define FASTPATH_OUTPUT_ACTION_FASTPATH 0x0 #define FASTPATH_OUTPUT_ACTION_X224 0x3 /* Server Fast-Path Update PDU: flags (MS-RDPBCGR 2.2.0.1.2) */ #define FASTPATH_OUTPUT_ACTION_FASTPATH 0x0 #define FASTPATH_OUTPUT_SECURE_CHECKSUM 0x1 #define FASTPATH_OUTPUT_ENCRYPTED 0x2 /* Fast-Path Update: updateCode (MS-RDPBCGR 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 (MS-RDPBCGR 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 /* Mouse Event: pointerFlags (MS-RDPBCGR 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 (MS-RDPBCGR 2.2.8.1.1.3.1.1.4) */ #define PTRXFLAGS_DOWN 0x8000 #define PTRXFLAGS_BUTTON1 0x0001 #define PTRXFLAGS_BUTTON2 0x0002 /* General Capability Set: osMajorType (MS-RDPBCGR 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 (MS-RDPBCGR 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 /* Window List Capability Set: WndSupportLevel (MS-RDPERP 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 /* Extended Info Packet: performanceFlags (MS-RDPBCGR 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 */ /* Virtual channel options */ /* Channel Definition Structure: options (MS-RDPBCGR 2.2.1.3.4.1) */ #define REMOTE_CONTROL_PERSISTENT 0x00100000 /* NOTE: XR_ prefixed to avoid conflict with FreeRDP */ #define XR_CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 #define XR_CHANNEL_OPTION_COMPRESS 0x00400000 #define XR_CHANNEL_OPTION_COMPRESS_RDP 0x00800000 #define XR_CHANNEL_OPTION_PRI_LOW 0x02000000 #define XR_CHANNEL_OPTION_PRI_MED 0x04000000 #define XR_CHANNEL_OPTION_PRI_HIGH 0x08000000 #define XR_CHANNEL_OPTION_ENCRYPT_CS 0x10000000 #define XR_CHANNEL_OPTION_ENCRYPT_SC 0x20000000 #define XR_CHANNEL_OPTION_ENCRYPT_RDP 0x40000000 #define XR_CHANNEL_OPTION_INITIALIZED 0x80000000 /* RDPDR: Device Announce Header: DeviceType (MS-RDPEFS 2.2.1.3) */ /* TODO: to be renamed */ #define DEVICE_TYPE_SERIAL 0x01 #define DEVICE_TYPE_PARALLEL 0x02 #define DEVICE_TYPE_PRINTER 0x04 #define DEVICE_TYPE_DISK 0x08 #define DEVICE_TYPE_SCARD 0x20 /* Order Capability Set: orderSupportExFlags (MS-RDPBCGR 2.2.7.1.3) */ #define XR_ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT 0x0002 #define XR_ORDERFLAGS_EX_ALTSEC_FRAME_MARKER_SUPPORT 0x0004 #define XR_ORDERFLAGS_EX_OFFSCREEN_COMPOSITE_SUPPORT 0x0100 /* Order Capability Set: orderSupport (MS-RDPBCGR 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 */ /* General Capability Set: extraFlags (MS-RDPBCGR 2.2.7.1.1) */ #define TS_CAPS_PROTOCOLVERSION 0x0200 #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: orderFlags (MS-RDPBCGR 2.2.7.1.3) */ #define NEGOTIATEORDERSUPPORT 0x0002 #define ZEROBOUNDSDELTASUPPORT 0x0008 #define COLORINDEXSUPPORT 0x0020 #define SOLIDPATTERNBRUSHONLY 0x0040 #define ORDERFLAGS_EXTRA_FLAGS 0x0080 /* Input Capability Set: inputFlags (MS-RDPBCGR 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 /* Desktop Composition Capability Set: CompDeskSupportLevel (MS-RDPBCGR 2.2.7.2.8) */ #define COMPDESK_NOT_SUPPORTED 0x0000 #define COMPDESK_SUPPORTED 0x0001 /* Surface Commands Capability Set: cmdFlags (MS-RDPBCGR 2.2.7.2.9) */ #define SURFCMDS_SETSURFACEBITS 0x00000002 #define SURFCMDS_FRAMEMARKER 0x00000010 #define SURFCMDS_STREAMSUFRACEBITS 0x00000040 /* Bitmap Codec: codecGUID (MS-RDPBCGR 2.2.7.2.10.1.1) */ /* CODEC_GUID_NSCODEC CA8D1BB9-000F-154F-589FAE2D1A87E2D6 */ #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-AFB3B73C9C6F7886 */ #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 0x34363248-0000-0010-800000AA00389B71 */ #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-869ACB8B37B66237 */ #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-ADAA0F83E57CC560 */ #define XR_CODEC_GUID_PNG \ "\x8D\x85\x0C\x0E\xE0\x28\xDB\x45\xAD\xAA\x0F\x83\xE5\x7C\xC5\x60" /* Surface Command Type (MS-RDPBCGR 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 /* RDP5 disconnect PDU */ /* Set Error Info PDU Data: errorInfo (MS-RDPBCGR 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 /* Info Packet (TS_INFO_PACKET): flags (MS-RDPBCGR 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 /* Compression Flags (MS-RDPBCGR 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 */ /* Drawing Order: controlFlags (MS-RDPEGDI 2.2.2.2.1, ) */ #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 (MS-RDPEGDI 2.2.2.2.1.1.2) ? */ #define RDP_ORDER_DESTBLT 0 #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 */ /* Secondary Drawing Order Header: orderType (MS-RDPEGDI 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 /* Maps to generalCapabilitySet in T.128 page 138 */ /* Capability Set: capabilitySetType (MS-RDPBCGR 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 /* TS_SECURITY_HEADER: flags (MS-RDPBCGR 2.2.8.1.1.2.1) */ /* TODO: to be renamed */ #define SEC_CLIENT_RANDOM 0x0001 /* SEC_EXCHANGE_PKT? */ #define SEC_ENCRYPT 0x0008 #define SEC_LOGON_INFO 0x0040 /* SEC_INFO_PKT */ #define SEC_LICENCE_NEG 0x0080 /* SEC_LICENSE_PKT */ #define SEC_TAG_SRV_INFO 0x0c01 /* SC_CORE */ #define SEC_TAG_SRV_CRYPT 0x0c02 /* SC_SECURITY */ #define SEC_TAG_SRV_CHANNELS 0x0c03 /* SC_NET? */ /* TS_UD_HEADER: type (MS-RDPBCGR (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 */ /* Server Proprietary Certificate (MS-RDPBCGR 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 */ /* LicensingMessage (MS-RDPELE 2.2.2) */ /* TODO: to be renamed */ #define LICENCE_TAG_DEMAND 0x01 /* LICNSE_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 /* LICENSE_BINARY_BLOB (MS-RDPBCGR 2.2.1.12.1.2) */ #define LICENCE_TAG_USER 0x000f /* BB_CLIENT_USER_NAME_BLOB */ #define LICENCE_TAG_HOST 0x0010 /* BB_CLIENT_MACHINE_NAME_BLOB */ /* Share Data Header: pduType2 (MS-RDPBCGR 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 RDP_DATA_PDU_LOGON 38 #define RDP_DATA_PDU_FONT2 39 #define RDP_DATA_PDU_DISCONNECT 47 /* Control PDU Data: action (MS-RDPBCGR 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 /* Slow-Path Graphics Update: updateType (MS-RDPBCGR 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 /* Server Pointer Update PDU: messageType (MS-RDPBCGR 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 (MS-RDPBCGR 2.2.9.1.1.4.3) */ #define RDP_NULL_POINTER 0 #define RDP_DEFAULT_POINTER 0x7F00 /* Keyboard Event: keyboardFlags (MS-RDPBCGR 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 /* Synchronize Event: toggleFlags (MS-RDPBCGR 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 /* Glyph Cache Capability Set: GlyphSupportLevel (MS-RDPBCGR 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 /****************************************************************************** * * 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 */ #define STATUS_SUCCESS 0x00000000 #define STATUS_PENDING 0x00000103 #define STATUS_NO_MORE_FILES 0x80000006 #define STATUS_DEVICE_PAPER_EMPTY 0x8000000e #define STATUS_DEVICE_POWERED_OFF 0x8000000f #define STATUS_DEVICE_OFF_LINE 0x80000010 #define STATUS_DEVICE_BUSY 0x80000011 #define STATUS_INVALID_HANDLE 0xc0000008 #define STATUS_INVALID_PARAMETER 0xc000000d #define STATUS_NO_SUCH_FILE 0xc000000f #define STATUS_INVALID_DEVICE_REQUEST 0xc0000010 #define STATUS_ACCESS_DENIED 0xc0000022 #define STATUS_OBJECT_NAME_COLLISION 0xc0000035 #define STATUS_DISK_FULL 0xc000007f #define STATUS_FILE_IS_A_DIRECTORY 0xc00000ba #define STATUS_NOT_SUPPORTED 0xc00000bb #define STATUS_TIMEOUT 0xc0000102 #define STATUS_CANCELLED 0xc0000120 /* MS-SMB2 2.2.13 */ /* TODO: not used anywhere */ #define FILE_DIRECTORY_FILE 0x00000001 #define FILE_NON_DIRECTORY_FILE 0x00000040 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 /* * not yet sorted out */ #define MCS_CONNECT_INITIAL 0x7f65 #define MCS_CONNECT_RESPONSE 0x7f66 #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 /* PDU Types (MS-RDPBCGR 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 /* 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 /* messages */ #define WM_PAINT 3 #define WM_KEYDOWN 15 #define WM_KEYUP 16 #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_INVALIDATE 200 #define CB_ITEMCHANGE 300 #define FASTPATH_MAX_PACKET_SIZE 0x3fff #define XR_RDP_SCAN_LSHIFT 42 #define XR_RDP_SCAN_ALT 56 #endif xrdp-0.9.12/common/parse.h000644 001751 001751 00000033634 13544635323 015274 0ustar00metameta000000 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" #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; }; /******************************************************************************/ #define s_check(s) ((s)->p <= (s)->end) /******************************************************************************/ #define s_check_rem(s, n) ((s)->p + (n) <= (s)->end) /******************************************************************************/ #define s_check_rem_out(s, n) ((s)->p + (n) <= (s)->data + (s)->size) /******************************************************************************/ #define s_check_end(s) ((s)->p == (s)->end) /******************************************************************************/ #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 \ { \ (v) = *((signed char*)((s)->p)); \ (s)->p++; \ } while (0) /******************************************************************************/ #define in_uint8(s, v) do \ { \ (v) = *((unsigned char*)((s)->p)); \ (s)->p++; \ } while (0) /******************************************************************************/ #define in_uint8_peek(s, v) do { v = *s->p; } while (0) /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define in_sint16_le(s, v) do \ { \ (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 \ { \ (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 \ { \ (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 \ { \ (v) = *((unsigned short*)((s)->p)); \ (s)->p += 2; \ } while (0) #endif /******************************************************************************/ #define in_uint16_be(s, v) do \ { \ (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 \ { \ (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 \ { \ (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 \ { \ (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 \ { \ (v) = *((tui64*)((s)->p)); \ (s)->p += 8; \ } while (0) #endif /******************************************************************************/ #define in_uint32_be(s, v) do \ { \ (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)->p) = (unsigned char)(v); \ (s)->p++; \ } while (0) /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define out_uint16_le(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(s, v) do \ { \ *((unsigned short*)((s)->p)) = (unsigned short)(v); \ (s)->p += 2; \ } while (0) #endif /******************************************************************************/ #define out_uint16_be(s, v) do \ { \ *((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)->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 \ { \ *((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)->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 \ { \ *((tui64*)((s)->p)) = (v); \ (s)->p += 8; \ } while (0) #endif /******************************************************************************/ #define out_uint32_be(s, v) do \ { \ *((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 \ { \ (v) = (s)->p; \ (s)->p += (n); \ } while (0) /******************************************************************************/ #define in_uint8a(s, v, n) do \ { \ g_memcpy((v), (s)->p, (n)); \ (s)->p += (n); \ } while (0) /******************************************************************************/ #define in_uint8s(s, n) \ (s)->p += (n) /******************************************************************************/ #define out_uint8p(s, v, n) do \ { \ 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 \ { \ 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_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.9.12/common/file.h000644 001751 001751 00000002136 13544635323 015072 0ustar00metameta000000 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.9.12/common/ssl_calls.h000644 001751 001751 00000006306 13544635323 016135 0ustar00metameta000000 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" 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, 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, 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); /* ssl_tls */ struct ssl_tls { struct ssl_st *ssl; /* SSL * */ struct ssl_ctx_st *ctx; /* SSL_CTX * */ char *cert; char *key; struct trans *trans; tintptr rwo; /* wait obj */ }; /* 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_st *ssl); const char * ssl_get_cipher_name(const struct ssl_st *ssl); int ssl_get_protocols_from_string(const char *str, long *ssl_protocols); const char * get_openssl_version(); #endif xrdp-0.9.12/common/pixman-region.c000644 001751 001751 00000233717 13544635323 016736 0ustar00metameta000000 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. */ #if defined(HAVE_CONFIG_H) #include #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) #ifdef XRDP_DEBUG #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 retangles 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) free (ri); GOOD (badreg); return ret; bail: for (i = 0; i < num_ri; i++) FREE_DATA (&ri[i].reg); if (ri != stack_regions) 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.9.12/common/thread_calls.c000644 001751 001751 00000011733 13544635323 016576 0ustar00metameta000000 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.9.12/common/xrdp_sockets.h000644 001751 001751 00000003146 13544635323 016665 0ustar00metameta000000 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 /* basename of socket files */ #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 of sockets */ #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.9.12/common/fifo.c000644 001751 001751 00000006744 13544635323 015102 0ustar00metameta000000 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. * * FIFO implementation to store pointer to data struct */ #if defined(HAVE_CONFIG_H) #include #endif #include "fifo.h" #include "os_calls.h" /** * Create new fifo data struct * * @return pointer to new FIFO or NULL if system out of memory *****************************************************************************/ FIFO * fifo_create(void) { return (FIFO *) g_malloc(sizeof(FIFO), 1); } /** * Delete specified FIFO *****************************************************************************/ void fifo_delete(FIFO *self) { USER_DATA *udp; if (!self) return; if (!self->head) { /* FIFO is empty */ g_free(self); return; } if (self->head == self->tail) { /* only one item in FIFO */ if (self->auto_free) g_free(self->head->item); g_free(self->head); g_free(self); return; } /* more then one item in FIFO */ while (self->head) { udp = self->head; if (self->auto_free) g_free(udp->item); self->head = udp->next; g_free(udp); } g_free(self); } /** * Add an item to the specified FIFO * * @param self FIFO to operate on * @param item item to add to specified FIFO * * @return 0 on success, -1 on error *****************************************************************************/ int fifo_add_item(FIFO *self, void *item) { USER_DATA *udp; if (!self || !item) return -1; if ((udp = (USER_DATA *) g_malloc(sizeof(USER_DATA), 0)) == 0) return -1; udp->item = item; udp->next = 0; /* if fifo is empty, add to head */ if (!self->head) { self->head = udp; self->tail = udp; return 0; } /* add to tail */ self->tail->next = udp; self->tail = udp; return 0; } /** * Return an item from top of FIFO * * @param self FIFO to operate on * * @return top item from FIFO or NULL if FIFO is empty *****************************************************************************/ void * fifo_remove_item(FIFO *self) { void *item; USER_DATA *udp; if (!self || !self->head) return 0; if (self->head == self->tail) { /* only one item in FIFO */ item = self->head->item; g_free(self->head); self->head = 0; self->tail = 0; return item; } /* more then one item in FIFO */ udp = self->head; item = self->head->item; self->head = self->head->next; g_free(udp); return item; } /** * Return FIFO status * * @param self FIFO to operate on * * @return true if FIFO is empty, false otherwise *****************************************************************************/ int fifo_is_empty(FIFO *self) { if (!self) return 1; return (self->head == 0); } xrdp-0.9.12/common/log.c000644 001751 001751 00000037321 13544635323 014733 0ustar00metameta000000 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 "list.h" #include "file.h" #include "os_calls.h" #include "thread_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) { ret = open(fname, O_WRONLY | O_CREAT | O_APPEND | O_SYNC, S_IRUSR | S_IWUSR); } #ifdef FD_CLOEXEC if (ret != -1) { fcntl(ret, F_SETFD, FD_CLOEXEC); } #endif 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 logfile is NULL, we return error */ if (0 == l_cfg->log_file) { g_writeln("log_file not properly assigned"); return ret; } /* if progname is NULL, we return error */ if (0 == l_cfg->program_name) { g_writeln("program_name not properly assigned"); return ret; } /* open file */ 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 th 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; } enum logReturns internalReadConfiguration(const char *inFilename, const char *applicationName) { int fd; enum logReturns ret = LOG_GENERAL_ERROR; struct list *param_n; struct list *param_v; if (inFilename == NULL) { g_writeln("The inifile is null to readConfiguration!"); return ret; } fd = g_file_open(inFilename); if (-1 == fd) { ret = LOG_ERROR_NO_CFG; g_writeln("We could not open the configuration file to read log parameters"); return ret; } /* we initialize the memory for the configuration and set all content to zero. */ ret = internalInitAndAllocStruct(); if (ret != LOG_STARTUP_OK) { g_file_close(fd); return ret; } param_n = list_create(); param_n->auto_free = 1; param_v = list_create(); param_v->auto_free = 1; /* read logging config */ ret = internal_config_read_logging(fd, g_staticLogConfig, param_n, param_v, applicationName); /* cleanup */ list_delete(param_v); list_delete(param_n); g_file_close(fd); return ret; } /******************************************************************************/ enum logReturns internal_config_read_logging(int file, struct log_config *lc, struct list *param_n, struct list *param_v, const char *applicationName) { int i; char *buf; char *temp_buf; 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_DEBUG; lc->enable_syslog = 0; lc->syslog_level = LOG_LEVEL_DEBUG; file_read_section(file, SESMAN_CFG_LOGGING, 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] != '/') { 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 == lc->log_file) { lc->log_file = g_strdup("./sesman.log"); } /* try to create path if not exist */ g_create_path(lc->log_file); g_printf("logging configuration:\r\n"); g_printf("\tLogFile: %s\r\n", lc->log_file); g_printf("\tLogLevel: %i\r\n", lc->log_level); g_printf("\tEnableSyslog: %i\r\n", lc->enable_syslog); g_printf("\tSyslogLevel: %i\r\n", lc->syslog_level); return LOG_STARTUP_OK; } enum logReturns internalInitAndAllocStruct(void) { enum logReturns ret = LOG_GENERAL_ERROR; g_staticLogConfig = g_new0(struct log_config, 1); if (g_staticLogConfig != NULL) { g_staticLogConfig->fd = -1; g_staticLogConfig->enable_syslog = 0; ret = LOG_STARTUP_OK; } else { g_writeln("could not allocate memory for log struct"); ret = LOG_ERROR_MALLOC; } return ret; } /* * Here below the public functions */ enum logReturns log_start_from_param(const struct log_config *iniParams) { enum logReturns ret = LOG_GENERAL_ERROR; if (g_staticLogConfig != NULL) { log_message(LOG_LEVEL_ALWAYS, "Log already initialized"); return ret; } if (iniParams == NULL) { g_writeln("inparam to log_start_from_param is NULL"); return ret; } else { /*Copy the struct information*/ ret = internalInitAndAllocStruct(); if (ret != LOG_STARTUP_OK) { g_writeln("internalInitAndAllocStruct failed"); return ret; } g_staticLogConfig->enable_syslog = iniParams->enable_syslog; g_staticLogConfig->fd = iniParams->fd; g_staticLogConfig->log_file = g_strdup(iniParams->log_file); g_staticLogConfig->log_level = iniParams->log_level; g_staticLogConfig->log_lock = iniParams->log_lock; g_staticLogConfig->log_lock_attr = iniParams->log_lock_attr; g_staticLogConfig->program_name = iniParams->program_name; g_staticLogConfig->syslog_level = iniParams->syslog_level; ret = internal_log_start(g_staticLogConfig); if (ret != LOG_STARTUP_OK) { g_writeln("Could not start log"); if (g_staticLogConfig != NULL) { g_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) { enum logReturns ret = LOG_GENERAL_ERROR; if (applicationName == NULL) { g_writeln("Programming error your application name cannot be null"); return ret; } ret = internalReadConfiguration(iniFile, applicationName); if (ret == LOG_STARTUP_OK) { ret = internal_log_start(g_staticLogConfig); if (ret != LOG_STARTUP_OK) { g_writeln("Could not start log"); if (g_staticLogConfig != NULL) { g_free(g_staticLogConfig); g_staticLogConfig = NULL; } } } 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); if (g_staticLogConfig != NULL) { g_free(g_staticLogConfig); g_staticLogConfig = NULL; } return ret; } enum logReturns log_message(const enum logLevels lvl, const char *msg, ...) { char buff[LOG_BUFFER_SIZE + 31]; /* 19 (datetime) 4 (space+cr+lf+\0) */ va_list ap; int len = 0; enum logReturns rv = LOG_STARTUP_OK; int writereply = 0; time_t now_t; struct tm *now; 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) { return LOG_ERROR_FILE_NOT_OPEN; } now_t = time(&now_t); now = localtime(&now_t); snprintf(buff, 21, "[%.4d%.2d%.2d-%.2d:%.2d:%.2d] ", now->tm_year + 1900, now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec); internal_log_lvl2str(lvl, buff + 20); va_start(ap, msg); len = vsnprintf(buff + 28, LOG_BUFFER_SIZE, msg, ap); va_end(ap); /* checking for truncated messages */ if (len > LOG_BUFFER_SIZE) { log_message(LOG_LEVEL_WARNING, "next message will be truncated"); } /* forcing the end of message string */ #ifdef _WIN32 buff[len + 28] = '\r'; buff[len + 29] = '\n'; buff[len + 30] = '\0'; #else #ifdef _MACOS buff[len + 28] = '\r'; buff[len + 29] = '\0'; #else buff[len + 28] = '\n'; buff[len + 29] = '\0'; #endif #endif if (g_staticLogConfig->enable_syslog && (lvl <= g_staticLogConfig->syslog_level)) { /* log to syslog*/ /* %s fix compiler warning 'not a string literal' */ syslog(internal_log_xrdp2syslog(lvl), "(%d)(%lld)%s", g_getpid(), (long long) tc_get_threadid(), buff + 20); } if (lvl <= g_staticLogConfig->log_level) { /* log to console */ g_printf("%s", buff); /* log to application logfile */ #ifdef LOG_ENABLE_THREAD pthread_mutex_lock(&(g_staticLogConfig->log_lock)); #endif if (g_staticLogConfig->fd >= 0) { 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; } xrdp-0.9.12/common/list16.c000644 001751 001751 00000010356 13544635323 015273 0ustar00metameta000000 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.9.12/common/list.c000644 001751 001751 00000012175 13544635323 015125 0ustar00metameta000000 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 "list.h" /*****************************************************************************/ struct list * list_create(void) { struct list *self; self = (struct list *)g_malloc(sizeof(struct list), 1); self->grow_by = 10; self->alloc_size = 10; self->items = (tbus *)g_malloc(sizeof(tbus) * 10, 1); return self; } /*****************************************************************************/ void list_delete(struct list *self) { int i; if (self == 0) { return; } if (self->auto_free) { for (i = 0; i < self->count; i++) { g_free((void *)self->items[i]); self->items[i] = 0; } } g_free(self->items); g_free(self); } /*****************************************************************************/ void list_add_item(struct list *self, tbus item) { tbus *p; int i; if (self->count >= self->alloc_size) { i = self->alloc_size; self->alloc_size += self->grow_by; p = (tbus *)g_malloc(sizeof(tbus) * self->alloc_size, 1); g_memcpy(p, self->items, sizeof(tbus) * i); g_free(self->items); self->items = p; } self->items[self->count] = item; self->count++; } /*****************************************************************************/ 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++) { g_free((void *)self->items[i]); self->items[i] = 0; } } g_free(self->items); self->count = 0; self->grow_by = 10; self->alloc_size = 10; self->items = (tbus *)g_malloc(sizeof(tbus) * 10, 1); } /*****************************************************************************/ 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) { g_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--; } } /*****************************************************************************/ void list_insert_item(struct list *self, int index, tbus item) { tbus *p; int i; if (index == self->count) { list_add_item(self, item); return; } if (index >= 0 && index < self->count) { self->count++; if (self->count > self->alloc_size) { i = self->alloc_size; self->alloc_size += self->grow_by; p = (tbus *)g_malloc(sizeof(tbus) * self->alloc_size, 1); g_memcpy(p, self->items, sizeof(tbus) * i); 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; } } /*****************************************************************************/ /* 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 */ void list_append_list_strdup(struct list *self, struct list *dest, int start_index) { int index; tbus item; char *dup; for (index = start_index; index < self->count; index++) { item = list_get_item(self, index); dup = g_strdup((char *)item); list_add_item(dest, (tbus)dup); } } /*****************************************************************************/ void list_dump_items(struct list *self) { int index; if (self->count == 0) { g_writeln("List is empty"); } for (index = 0; index < self->count; index++) { g_writeln("%d: %p", index, (void *) list_get_item(self, index)); } } xrdp-0.9.12/common/os_calls.c000644 001751 001751 00000257230 13544635323 015754 0ustar00metameta000000 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) #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #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 "arch.h" #include "log.h" /* for clearenv() */ #if defined(_WIN32) #else extern char **environ; #endif #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 /*****************************************************************************/ int g_rm_temp_dir(void) { return 0; } /*****************************************************************************/ int g_mk_socket_path(const char *app_name) { if (!g_directory_exist(XRDP_SOCKET_PATH)) { if (!g_create_path(XRDP_SOCKET_PATH"/")) { /* if failed, still check if it got created by someone else */ if (!g_directory_exist(XRDP_SOCKET_PATH)) { log_message(LOG_LEVEL_ERROR, "g_mk_socket_path: g_create_path(%s) failed", XRDP_SOCKET_PATH); return 1; } } g_chmod_hex(XRDP_SOCKET_PATH, 0x1777); } return 0; } /*****************************************************************************/ void g_init(const char *app_name) { #if defined(_WIN32) WSADATA wsadata; WSAStartup(2, &wsadata); #endif /* In order to get g_mbstowcs and g_wcstombs to work properly with UTF-8 non-ASCII characters, LC_CTYPE cannot be "C" or blank. To select UTF-8 encoding without specifying any countries/languages, "C.UTF-8" is used but provided in few systems. See also: https://sourceware.org/glibc/wiki/Proposals/C.UTF-8 */ char *lc_ctype; lc_ctype = setlocale(LC_CTYPE, "C.UTF-8"); if (lc_ctype == NULL) { /* use en_US.UTF-8 instead if not available */ setlocale(LC_CTYPE, "en_US.UTF-8"); } g_mk_socket_path(app_name); } /*****************************************************************************/ void g_deinit(void) { #if defined(_WIN32) WSACleanup(); #endif g_rm_temp_dir(); } /*****************************************************************************/ /* allocate memory, returns a pointer to it, size bytes are allocated, if zero is non zero, each byte will be set to zero */ void * g_malloc(int size, int zero) { char *rv; rv = (char *)malloc(size); if (zero) { if (rv != 0) { memset(rv, 0, size); } } return rv; } /*****************************************************************************/ /* free the memory pointed to by ptr, ptr can be zero */ void g_free(void *ptr) { if (ptr != 0) { free(ptr); } } /*****************************************************************************/ /* 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); } /*****************************************************************************/ /* produce a hex dump */ 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; } } /*****************************************************************************/ void g_memset(void *ptr, int val, int size) { memset(ptr, val, size); } /*****************************************************************************/ void g_memcpy(void *d_ptr, const void *s_ptr, int size) { memcpy(d_ptr, s_ptr, size); } /*****************************************************************************/ 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 { g_writeln("Error setting tcp_nodelay"); } } } else { g_writeln("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 { g_writeln("Error setting tcp_keepalive"); } } } else { g_writeln("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 EAFNOSUPPORT: /* if IPv6 not supported, retry IPv4 */ log_message(LOG_LEVEL_INFO, "IPv6 not supported, falling back to IPv4"); rv = (int)socket(AF_INET, SOCK_STREAM, 0); break; default: log_message(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_message(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_message(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_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed"); } } } 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); if (setsockopt(rv, SOL_SOCKET, SO_SNDBUF, (char *)&option_value, option_len) < 0) { log_message(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_vsock_socket(void) { #if defined(XRDP_ENABLE_VSOCK) return socket(PF_VSOCK, SOCK_STREAM, 0); #else 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_SOCKET, 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 } /*****************************************************************************/ void g_sck_close(int sck) { #if defined(_WIN32) closesocket(sck); #else char sockname[128]; union { struct sockaddr sock_addr; struct sockaddr_in sock_addr_in; #if defined(XRDP_ENABLE_IPV6) struct sockaddr_in6 sock_addr_in6; #endif #if defined(XRDP_ENABLE_VSOCK) struct sockaddr_vm sock_addr_vm; #endif } sock_info; socklen_t sock_len = sizeof(sock_info); memset(&sock_info, 0, sizeof(sock_info)); if (getsockname(sck, &sock_info.sock_addr, &sock_len) == 0) { switch (sock_info.sock_addr.sa_family) { case AF_INET: { struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in; g_snprintf(sockname, sizeof(sockname), "AF_INET %s:%d", inet_ntoa(sock_addr_in->sin_addr), ntohs(sock_addr_in->sin_port)); break; } #if defined(XRDP_ENABLE_IPV6) case AF_INET6: { char addr[48]; struct sockaddr_in6 *sock_addr_in6 = &sock_info.sock_addr_in6; g_snprintf(sockname, sizeof(sockname), "AF_INET6 %s port %d", inet_ntop(sock_addr_in6->sin6_family, &sock_addr_in6->sin6_addr, addr, sizeof(addr)), ntohs(sock_addr_in6->sin6_port)); break; } #endif case AF_UNIX: g_snprintf(sockname, sizeof(sockname), "AF_UNIX"); break; #if defined(XRDP_ENABLE_VSOCK) case AF_VSOCK: { struct sockaddr_vm *sock_addr_vm = &sock_info.sock_addr_vm; g_snprintf(sockname, sizeof(sockname), "AF_VSOCK cid %d port %d", sock_addr_vm->svm_cid, sock_addr_vm->svm_port); break; } #endif default: g_snprintf(sockname, sizeof(sockname), "unknown family %d", sock_info.sock_addr.sa_family); break; } } else { log_message(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_message(LOG_LEVEL_DEBUG, "Closed socket %d (%s)", sck, sockname); } else { log_message(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_message(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_message(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_message(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) 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)); #else return -1; #endif } /*****************************************************************************/ int g_sck_vsock_bind_address(int sck, const char *port, const char *address) { #if defined(XRDP_ENABLE_VSOCK) 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)); #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_message(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_message(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_message(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_tcp_accept(int sck) { int ret; char msg[256]; union { struct sockaddr sock_addr; struct sockaddr_in sock_addr_in; #if defined(XRDP_ENABLE_IPV6) struct sockaddr_in6 sock_addr_in6; #endif } 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) { switch(sock_info.sock_addr.sa_family) { case AF_INET: { struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in; g_snprintf(msg, sizeof(msg), "A connection received from %s port %d", inet_ntoa(sock_addr_in->sin_addr), ntohs(sock_addr_in->sin_port)); log_message(LOG_LEVEL_INFO, "%s", msg); break; } #if defined(XRDP_ENABLE_IPV6) case AF_INET6: { struct sockaddr_in6 *sock_addr_in6 = &sock_info.sock_addr_in6; char addr[256]; inet_ntop(sock_addr_in6->sin6_family, &sock_addr_in6->sin6_addr, addr, sizeof(addr)); g_snprintf(msg, sizeof(msg), "A connection received from %s port %d", addr, ntohs(sock_addr_in6->sin6_port)); log_message(LOG_LEVEL_INFO, "%s", msg); break; } #endif } } return ret; } /*****************************************************************************/ int g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes) { int ret; char msg[256]; union { struct sockaddr sock_addr; struct sockaddr_in sock_addr_in; #if defined(XRDP_ENABLE_IPV6) struct sockaddr_in6 sock_addr_in6; #endif struct sockaddr_un sock_addr_un; #if defined(XRDP_ENABLE_VSOCK) struct sockaddr_vm sock_addr_vm; #endif } 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) { switch(sock_info.sock_addr.sa_family) { case AF_INET: { struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in; g_snprintf(addr, addr_bytes, "%s", inet_ntoa(sock_addr_in->sin_addr)); g_snprintf(port, port_bytes, "%d", ntohs(sock_addr_in->sin_port)); g_snprintf(msg, sizeof(msg), "AF_INET connection received from %s port %s", addr, port); break; } #if defined(XRDP_ENABLE_IPV6) case AF_INET6: { struct sockaddr_in6 *sock_addr_in6 = &sock_info.sock_addr_in6; inet_ntop(sock_addr_in6->sin6_family, &sock_addr_in6->sin6_addr, addr, addr_bytes); g_snprintf(port, port_bytes, "%d", ntohs(sock_addr_in6->sin6_port)); g_snprintf(msg, sizeof(msg), "AF_INET6 connection received from %s port %s", addr, port); break; } #endif case AF_UNIX: { g_strncpy(addr, "", addr_bytes - 1); g_strncpy(port, "", port_bytes - 1); g_snprintf(msg, sizeof(msg), "AF_UNIX connection received"); break; } #if defined(XRDP_ENABLE_VSOCK) case AF_VSOCK: { struct sockaddr_vm *sock_addr_vm = &sock_info.sock_addr_vm; g_snprintf(addr, addr_bytes - 1, "%d", sock_addr_vm->svm_cid); g_snprintf(port, addr_bytes - 1, "%d", sock_addr_vm->svm_port); g_snprintf(msg, sizeof(msg), "AF_VSOCK connection received from cid: %s port: %s", addr, port); break; } #endif default: { g_strncpy(addr, "", addr_bytes - 1); g_strncpy(port, "", port_bytes - 1); g_snprintf(msg, sizeof(msg), "connection received, unknown socket family %d", sock_info.sock_addr.sa_family); break; } } log_message(LOG_LEVEL_INFO, "Socket %d: %s", ret, msg); } return ret; } /*****************************************************************************/ /* * TODO: this function writes not only IP address, name is confusing */ void g_write_ip_address(int rcv_sck, char *ip_address, int bytes) { char *addr; int port; int ok; union { struct sockaddr sock_addr; struct sockaddr_in sock_addr_in; #if defined(XRDP_ENABLE_IPV6) struct sockaddr_in6 sock_addr_in6; #endif struct sockaddr_un sock_addr_un; } sock_info; ok = 0; socklen_t sock_len = sizeof(sock_info); memset(&sock_info, 0, sock_len); #if defined(XRDP_ENABLE_IPV6) addr = (char *)g_malloc(INET6_ADDRSTRLEN, 1); #else addr = (char *)g_malloc(INET_ADDRSTRLEN, 1); #endif if (getpeername(rcv_sck, (struct sockaddr *)&sock_info, &sock_len) == 0) { switch(sock_info.sock_addr.sa_family) { case AF_INET: { struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in; g_snprintf(addr, INET_ADDRSTRLEN, "%s", inet_ntoa(sock_addr_in->sin_addr)); port = ntohs(sock_addr_in->sin_port); ok = 1; break; } #if defined(XRDP_ENABLE_IPV6) case AF_INET6: { struct sockaddr_in6 *sock_addr_in6 = &sock_info.sock_addr_in6; inet_ntop(sock_addr_in6->sin6_family, &sock_addr_in6->sin6_addr, addr, INET6_ADDRSTRLEN); port = ntohs(sock_addr_in6->sin6_port); ok = 1; break; } #endif default: { break; } } if (ok) { g_snprintf(ip_address, bytes, "%s:%d - socket: %d", addr, port, rcv_sck); } } if (!ok) { g_snprintf(ip_address, bytes, "NULL:NULL - socket: %d", rcv_sck); } g_free(addr); } /*****************************************************************************/ void g_sleep(int msecs) { #if defined(_WIN32) Sleep(msecs); #else usleep(msecs * 1000); #endif } /*****************************************************************************/ 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, 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, int len, int flags) { #if defined(_WIN32) return send(sck, (const char *)ptr, len, flags); #else return send(sck, ptr, len, flags); #endif } /*****************************************************************************/ /* 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) { fd_set wfds; struct timeval time; int rv; time.tv_sec = millis / 1000; time.tv_usec = (millis * 1000) % 1000000; FD_ZERO(&wfds); if (sck > 0) { FD_SET(((unsigned int)sck), &wfds); rv = select(sck + 1, 0, &wfds, 0, &time); if (rv > 0) { return 1; } } return 0; } /*****************************************************************************/ /* wait 'millis' milliseconds for the socket to be able to receive */ /* returns boolean */ int g_sck_can_recv(int sck, int millis) { fd_set rfds; struct timeval time; int rv; g_memset(&time, 0, sizeof(time)); time.tv_sec = millis / 1000; time.tv_usec = (millis * 1000) % 1000000; FD_ZERO(&rfds); if (sck > 0) { FD_SET(((unsigned int)sck), &rfds); rv = select(sck + 1, &rfds, 0, 0, &time); if (rv > 0) { return 1; } } return 0; } /*****************************************************************************/ int g_sck_select(int sck1, int sck2) { fd_set rfds; struct timeval time; int max; int rv; g_memset(&time, 0, sizeof(struct timeval)); FD_ZERO(&rfds); if (sck1 > 0) { FD_SET(((unsigned int)sck1), &rfds); } if (sck2 > 0) { FD_SET(((unsigned int)sck2), &rfds); } max = sck1; if (sck2 > max) { max = sck2; } rv = select(max + 1, &rfds, 0, 0, &time); if (rv > 0) { rv = 0; if (FD_ISSET(((unsigned int)sck1), &rfds)) { rv = rv | 1; } if (FD_ISSET(((unsigned int)sck2), &rfds)) { rv = rv | 2; } } else { rv = 0; } return rv; } /*****************************************************************************/ /* returns boolean */ static int g_fd_can_read(int fd) { fd_set rfds; struct timeval time; int rv; g_memset(&time, 0, sizeof(time)); FD_ZERO(&rfds); FD_SET(((unsigned int)fd), &rfds); rv = select(fd + 1, &rfds, 0, 0, &time); if (rv == 1) { return 1; } return 0; } /*****************************************************************************/ /* 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; } 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 if (obj == 0) { return 0; } SetEvent((HANDLE)obj); return 0; #else int error; int fd; int written; int to_write; char buf[4] = "sig"; if (obj == 0) { return 0; } fd = obj & 0xffff; 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) { #ifdef _WIN32 HANDLE handles[256]; 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 < 1) { mstimeout = INFINITE; } error = WaitForMultipleObjects(count, handles, FALSE, mstimeout); if (error == WAIT_FAILED) { return 1; } return 0; #else fd_set rfds; fd_set wfds; struct timeval time; struct timeval *ptime; int i = 0; int res = 0; int max = 0; int sck = 0; max = 0; if (mstimeout < 1) { ptime = 0; } else { g_memset(&time, 0, sizeof(struct timeval)); time.tv_sec = mstimeout / 1000; time.tv_usec = (mstimeout % 1000) * 1000; ptime = &time; } FD_ZERO(&rfds); FD_ZERO(&wfds); /* Find the highest descriptor number in read_obj */ if (read_objs != NULL) { for (i = 0; i < rcount; i++) { sck = read_objs[i] & 0xffff; if (sck > 0) { FD_SET(sck, &rfds); if (sck > max) { max = sck; /* max holds the highest socket/descriptor number */ } } } } else if (rcount > 0) { g_writeln("Programming error read_objs is null"); return 1; /* error */ } if (write_objs != NULL) { for (i = 0; i < wcount; i++) { sck = (int)(write_objs[i]); if (sck > 0) { FD_SET(sck, &wfds); if (sck > max) { max = sck; /* max holds the highest socket/descriptor number */ } } } } else if (wcount > 0) { g_writeln("Programming error write_objs is null"); return 1; /* error */ } res = select(max + 1, &rfds, &wfds, 0, ptime); if (res < 0) { /* these are not really errors */ if ((errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINPROGRESS) || (errno == EINTR)) /* signal occurred */ { return 0; } return 1; /* error */ } return 0; #endif } /*****************************************************************************/ 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(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 int rv; rv = open(file_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); if (rv == -1) { /* can't open read / write, try to open read only */ rv = open(file_name, O_RDONLY); } return rv; #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 error, always 0 */ int g_file_close(int fd) { #if defined(_WIN32) CloseHandle((HANDLE)fd); #else close(fd); #endif return 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 } /*****************************************************************************/ /* returns error */ int g_chmod_hex(const char *filename, int flags) { #if defined(_WIN32) return 0; #else int fl; fl = 0; fl |= (flags & 0x4000) ? S_ISUID : 0; fl |= (flags & 0x2000) ? S_ISGID : 0; fl |= (flags & 0x1000) ? S_ISVTX : 0; fl |= (flags & 0x0400) ? S_IRUSR : 0; fl |= (flags & 0x0200) ? S_IWUSR : 0; fl |= (flags & 0x0100) ? S_IXUSR : 0; fl |= (flags & 0x0040) ? S_IRGRP : 0; fl |= (flags & 0x0020) ? S_IWGRP : 0; fl |= (flags & 0x0010) ? S_IXGRP : 0; fl |= (flags & 0x0004) ? S_IROTH : 0; fl |= (flags & 0x0002) ? S_IWOTH : 0; fl |= (flags & 0x0001) ? S_IXOTH : 0; return chmod(filename, fl); #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 */ int g_create_dir(const char *dirname) { #if defined(_WIN32) return CreateDirectoryA(dirname, 0); // test this #else return mkdir(dirname, (mode_t) - 1) == 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 length of text */ int g_strlen(const char *text) { if (text == NULL) { return 0; } return strlen(text); } /*****************************************************************************/ /* locates char in text */ const char * g_strchr(const char* text, int c) { if (text == NULL) { return 0; } return strchr(text,c); } /*****************************************************************************/ /* 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); } /*****************************************************************************/ /* 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); } /*****************************************************************************/ 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; } /*****************************************************************************/ 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); } /*****************************************************************************/ int g_mbstowcs(twchar *dest, const char *src, int n) { wchar_t *ldest; int rv; ldest = (wchar_t *)dest; rv = mbstowcs(ldest, src, n); return rv; } /*****************************************************************************/ int g_wcstombs(char *dest, const twchar *src, int n) { const wchar_t *lsrc; int rv; lsrc = (const wchar_t *)src; rv = wcstombs(dest, lsrc, n); return rv; } /*****************************************************************************/ /* returns error */ /* trim spaces and tabs, anything <= space */ /* trim_flags 1 trim left, 2 trim right, 3 trim both, 4 trim through */ /* this will always shorten the string or not change it */ int g_strtrim(char *str, int trim_flags) { int index; int len; int text1_index; int got_char; wchar_t *text; wchar_t *text1; len = mbstowcs(0, str, 0); if (len < 1) { return 0; } if ((trim_flags < 1) || (trim_flags > 4)) { return 1; } text = (wchar_t *)malloc(len * sizeof(wchar_t) + 8); text1 = (wchar_t *)malloc(len * sizeof(wchar_t) + 8); text1_index = 0; mbstowcs(text, str, len + 1); switch (trim_flags) { case 4: /* trim through */ for (index = 0; index < len; index++) { if (text[index] > 32) { text1[text1_index] = text[index]; text1_index++; } } text1[text1_index] = 0; break; case 3: /* trim both */ got_char = 0; for (index = 0; index < len; index++) { if (got_char) { text1[text1_index] = text[index]; text1_index++; } else { if (text[index] > 32) { text1[text1_index] = text[index]; text1_index++; got_char = 1; } } } text1[text1_index] = 0; len = text1_index; /* trim right */ for (index = len - 1; index >= 0; index--) { if (text1[index] > 32) { break; } } text1_index = index + 1; text1[text1_index] = 0; break; case 2: /* trim right */ /* copy it */ for (index = 0; index < len; index++) { text1[text1_index] = text[index]; text1_index++; } /* trim right */ for (index = len - 1; index >= 0; index--) { if (text1[index] > 32) { break; } } text1_index = index + 1; text1[text1_index] = 0; break; case 1: /* trim left */ got_char = 0; for (index = 0; index < len; index++) { if (got_char) { text1[text1_index] = text[index]; text1_index++; } else { if (text[index] > 32) { text1[text1_index] = text[index]; text1_index++; got_char = 1; } } } text1[text1_index] = 0; break; } wcstombs(str, text1, text1_index + 1); free(text); free(text1); return 0; } /*****************************************************************************/ 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(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 */ int g_execvp(const char *p1, char *args[]) { #if defined(_WIN32) return 0; #else int rv; g_rm_temp_dir(); rv = execvp(p1, args); g_mk_socket_path(0); return rv; #endif } /*****************************************************************************/ /* 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; g_rm_temp_dir(); rv = execlp(a1, a2, a3, (void *)0); g_mk_socket_path(0); return rv; #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_child_stop(void (*func)(int)) { #if defined(_WIN32) #else signal(SIGCHLD, func); #endif } /*****************************************************************************/ void g_signal_segfault(void (*func)(int)) { #if defined(_WIN32) #else signal(SIGSEGV, func); #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_hang_up(void (*func)(int)) { #if defined(_WIN32) #else signal(SIGHUP, func); #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_user_interrupt(void (*func)(int)) { #if defined(_WIN32) #else signal(SIGINT, func); #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_terminate(void (*func)(int)) { #if defined(_WIN32) #else signal(SIGTERM, func); #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_pipe(void (*func)(int)) { #if defined(_WIN32) #else signal(SIGPIPE, func); #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_usr1(void (*func)(int)) { #if defined(_WIN32) #else signal(SIGUSR1, func); #endif } /*****************************************************************************/ /* does not work in win32 */ int g_fork(void) { #if defined(_WIN32) return 0; #else int rv; rv = fork(); if (rv == 0) /* child */ { g_mk_socket_path(0); } 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 *user, int gid) { #if defined(_WIN32) return 0; #else return initgroups(user, gid); #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_setlogin(const char *name) { #ifdef BSD return setlogin(name); #else return -1; #endif } /*****************************************************************************/ /* does not work in win32 returns pid of process that exits or zero if signal occurred */ int g_waitchild(void) { #if defined(_WIN32) return 0; #else int wstat; int rv; rv = waitpid(0, &wstat, WNOHANG); if (rv == -1) { if (errno == EINTR) /* signal occurred */ { rv = 0; } } return rv; #endif } /*****************************************************************************/ /* does not work in win32 returns pid of process that exits or zero if signal occurred */ 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); if (rv == -1) { if (errno == EINTR) /* signal occurred */ { rv = 0; } } } return rv; #endif } /*****************************************************************************/ /* does not work in win32 */ void g_clearenv(void) { #if defined(_WIN32) #else #if defined(BSD) environ[0] = 0; #else environ = 0; #endif #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 } /*****************************************************************************/ /* returns 0 if ok */ /* the caller is responsible to free the buffs */ /* does not work in win32 */ int g_getuser_info(const char *username, int *gid, int *uid, char **shell, char **dir, char **gecos) { #if defined(_WIN32) return 1; #else struct passwd *pwd_1; pwd_1 = getpwnam(username); if (pwd_1 != 0) { if (gid != 0) { *gid = pwd_1->pw_gid; } if (uid != 0) { *uid = pwd_1->pw_uid; } if (dir != 0) { *dir = g_strdup(pwd_1->pw_dir); } if (shell != 0) { *shell = g_strdup(pwd_1->pw_shell); } 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 } /*****************************************************************************/ /* returns error */ /* if zero is returned, then ok is set */ /* does not work in win32 */ int g_check_user_in_group(const char *username, int gid, int *ok) { #if defined(_WIN32) return 1; #else struct group *groups; int i; groups = getgrgid(gid); if (groups == 0) { return 1; } *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 } /*****************************************************************************/ /* 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 { g_writeln("g_save_to_bpp: unimp"); 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) { g_writeln("g_save_to_bpp: open error"); return 1; } bytes = write(fd, &bm, sizeof(bm)); if (bytes != sizeof(bm)) { g_writeln("g_save_to_bpp: write error"); } bytes = write(fd, &bh, sizeof(bh)); if (bytes != sizeof(bh)) { g_writeln("g_save_to_bpp: write error"); } bytes = write(fd, &dh, sizeof(dh)); if (bytes != sizeof(dh)) { g_writeln("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) { g_writeln("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)) { g_writeln("g_save_to_bpp: write error"); } data -= stride_bytes; } } else { g_writeln("g_save_to_bpp: unimp"); } close(fd); return 0; } /*****************************************************************************/ /* returns boolean */ 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; } /*****************************************************************************/ /* 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 } xrdp-0.9.12/common/xrdp_client_info.h000644 001751 001751 00000010025 13544635323 017475 0ustar00metameta000000 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 */ #if !defined(XRDP_CLIENT_INFO_H) #define XRDP_CLIENT_INFO_H struct monitor_info { int left; int top; int right; int bottom; int is_primary; }; struct xrdp_client_info { int size; /* bytes for this structure */ int bpp; int width; int height; /* 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[256]; char password[256]; char domain[256]; char program[256]; char directory[256]; 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 */ char client_ip[256]; 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 */ char client_addr[256]; char client_port[256]; int security_layer; /* 0 = rdp, 1 = tls , 2 = hybrid */ int multimon; /* 0 = deny , 1 = allow */ int monitorCount; /* number of monitors detected (max = 16) */ struct monitor_info minfo[16]; /* client monitor data */ struct monitor_info minfo_wm[16]; /* client monitor data, non-negative values */ 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]; /* !!!!!!!!!!!!!!!!!!!!!!!!!! */ /* NO CHANGES ABOVE 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; int client_os_major; int client_os_minor; int no_orders_supported; int use_cache_glyph_v2; int rail_enable; int suppress_output; }; #endif xrdp-0.9.12/common/base64.h000644 001751 001751 00000001536 13544635323 015242 0ustar00metameta000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Koichiro Iwao 2017 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Base64 encoder / decoder */ #if !defined(SSL_CALLS_H) #define SSL_CALLS_H #include "arch.h" size_t base64_decoded_bytes(const char *src); char * base64_decode(char *dst, const char *src, size_t len); #endif xrdp-0.9.12/xrdp/xrdp_listen.c000644 001751 001751 00000070766 13601643631 016177 0ustar00metameta000000 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" /* '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_message(LOG_LEVEL_ERROR,"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; DEBUG(("process started")); process = g_process; g_process = 0; tc_sem_inc(g_process_sem); xrdp_process_main_loop(process); DEBUG(("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; char cfg_file[256]; struct xrdp_startup_params *startup_params; startup_params = self->startup_params; port_override = startup_params->port[0] != 0; fork_override = startup_params->fork; g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); fd = g_file_open(cfg_file); 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_message(LOG_LEVEL_INFO, "xrdp_listen_pp done"); cont = 0; break; } log_message(LOG_LEVEL_INFO, "address [%s] port [%s] mode %d", address, port, mode); ltrans = trans_create(mode, 16, 16); if (ltrans == NULL) { log_message(LOG_LEVEL_ERROR, "trans_create failed"); xrdp_listen_stop_all_listen(self); return 1; } log_message(LOG_LEVEL_INFO, "listening to port %s on %s", port, address); error = trans_listen_address(ltrans, port, address); if (error != 0) { log_message(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_message(LOG_LEVEL_ERROR, "Error setting tcp_nodelay"); } } if (startup_params->tcp_keepalive) { if (g_tcp_set_keepalive(ltrans->sck)) { log_message(LOG_LEVEL_ERROR, "Error setting " "tcp_keepalive"); } } if (startup_params->tcp_send_buffer_bytes > 0) { bytes = startup_params->tcp_send_buffer_bytes; log_message(LOG_LEVEL_INFO, "setting send buffer to %d bytes", bytes); if (g_sck_set_send_buffer_bytes(ltrans->sck, bytes) != 0) { log_message(LOG_LEVEL_ERROR, "error setting send buffer"); } else { if (g_sck_get_send_buffer_bytes(ltrans->sck, &bytes) != 0) { log_message(LOG_LEVEL_ERROR, "error getting send " "buffer"); } else { log_message(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; log_message(LOG_LEVEL_INFO, "setting recv buffer to %d bytes", bytes); if (g_sck_set_recv_buffer_bytes(ltrans->sck, bytes) != 0) { log_message(LOG_LEVEL_ERROR, "error setting recv buffer"); } else { if (g_sck_get_recv_buffer_bytes(ltrans->sck, &bytes) != 0) { log_message(LOG_LEVEL_ERROR, "error getting recv " "buffer"); } else { log_message(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; } /*****************************************************************************/ /* 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 sync_obj; intptr_t done_obj; struct trans *ltrans; self->status = 1; if (xrdp_listen_get_startup_params(self) != 0) { log_message(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_message(LOG_LEVEL_ERROR,"xrdp_listen_main_loop: xrdp_listen_get_port failed"); self->status = -1; return 1; } term_obj = g_get_term_event(); /*Global termination event */ 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++] = 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 */ { break; } /* 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.9.12/xrdp/xrdp_encoder.h000644 001751 001751 00000003110 13544635323 016305 0ustar00metameta000000 000000 #ifndef _XRDP_ENCODER_H #define _XRDP_ENCODER_H #include "arch.h" #include "fifo.h" 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; FIFO *fifo_to_proc; FIFO *fifo_processed; tbus mutex; int (*process_enc)(struct xrdp_encoder *self, struct xrdp_enc_data *enc); void *codec_handle; 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; }; /* used when scheduling tasks in xrdp_encoder.c */ struct xrdp_enc_data { struct xrdp_mod *mod; int num_drects; short *drects; /* 4 * num_drects */ int num_crects; short *crects; /* 4 * num_crects */ char *data; int width; int height; int flags; int frame_id; }; typedef struct xrdp_enc_data XRDP_ENC_DATA; /* 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 x; int y; int cx; int cy; }; 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.9.12/xrdp/xrdp_wm.c000644 001751 001751 00000177111 13544635324 015322 0ustar00metameta000000 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 "log.h" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do \ { \ if (_level < LLOG_LEVEL) \ { \ g_write("xrdp:xrdp_wm [%10.10u]: ", g_time3()); \ g_writeln _args ; \ } \ } \ while (0) /*****************************************************************************/ 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->width, client_info->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_mode_event_%8.8x", pid, owner->session_id); log_message(LOG_LEVEL_DEBUG, "%s", event_name); self->login_mode_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); self->default_font = xrdp_font_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_mode(self, 0); 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); return self; } /*****************************************************************************/ void xrdp_wm_delete(struct xrdp_wm *self) { if (self == 0) { return; } 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_mode_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 bytes; struct xrdp_pointer_item pointer_item; if (bpp == 0) { bpp = 24; } bytes = ((bpp + 7) / 8) * 32 * 32; g_memset(&pointer_item, 0, sizeof(struct xrdp_pointer_item)); pointer_item.x = x; pointer_item.y = y; pointer_item.bpp = bpp; g_memcpy(pointer_item.data, data, bytes); g_memcpy(pointer_item.mask, mask, 32 * 32 / 8); self->screen->pointer = xrdp_cache_add_pointer(self->cache, &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 bpp; int w; int h; int i; int j; int pixel; int palette[16]; struct stream *fs; if (!g_file_exist(file_name)) { log_message(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(file_name); if (fd < 0) { log_message(LOG_LEVEL_ERROR,"xrdp_wm_load_pointer: error loading pointer from file [%s]", file_name); xstream_free(fs); return 1; } g_file_read(fd, fs->data, 8192); g_file_close(fd); 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) { return libxrdp_send_pointer(self->session, cache_idx, data, mask, x, y, bpp); } /*****************************************************************************/ 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; char cfg_file[256]; 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 */ g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); fd = g_file_open(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, "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_message(LOG_LEVEL_ERROR,"xrdp_wm_load_static_colors: Could not read xrdp.ini file %s", cfg_file); } 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]; DEBUG(("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); DEBUG(("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; struct list *names; struct list *values; char *q; const char *r; char param[256]; char default_section_name[256]; char section_name[256]; char cfg_file[256]; char autorun_name[256]; g_writeln("in xrdp_wm_init: "); load_xrdp_config(self->xrdp_config, self->screen->bpp); /* global channels allow */ names = list_create(); names->auto_free = 1; values = list_create(); values->auto_free = 1; g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); if (file_by_name_read_section(cfg_file, "Channels", names, values) == 0) { int error; int ii; int chan_id; int chan_flags; int disabled; char chan_name[16]; ii = 0; error = libxrdp_query_channel(self->session, ii, chan_name, &chan_flags); while (error == 0) { r = NULL; for (index = 0; index < names->count; index++) { q = (char *) list_get_item(names, index); if (g_strcasecmp(q, chan_name) == 0) { r = (char *) list_get_item(values, index); break; } } if (r == NULL) { /* not found, disable the channel */ chan_id = libxrdp_get_channel_id(self->session, chan_name); libxrdp_disable_channel(self->session, chan_id, 1); g_writeln("xrdp_wm_init: channel %s channel id %d is " "disabled", chan_name, chan_id); } else { /* found */ chan_id = libxrdp_get_channel_id(self->session, q); disabled = !g_text2bool(r); libxrdp_disable_channel(self->session, chan_id, disabled); if (disabled) { g_writeln("xrdp_wm_init: channel %s channel id %d is " "disabled", chan_name, chan_id); } else { g_writeln("xrdp_wm_init: channel %s channel id %d is " "allowed", chan_name, chan_id); } } ii++; error = libxrdp_query_channel(self->session, ii, chan_name, &chan_flags); } } list_delete(names); list_delete(values); 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 */ g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); fd = g_file_open(cfg_file); /* xrdp.ini */ if (fd != -1) { names = list_create(); names->auto_free = 1; 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 = (char *)list_get_item(names, index); if ((g_strncasecmp("globals", q, 8) != 0) && (g_strncasecmp("Logging", q, 8) != 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_message(LOG_LEVEL_INFO, "Module \"%s\" specified by %s from %s port %s " "is not configured. Using \"%s\" instead.", section_name, self->session->client_info->username, self->session->client_info->client_addr, self->session->client_info->client_port, 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 = (char *)list_get_item(names, index); r = (char *)list_get_item(values, index); if (g_strncmp("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_strncmp("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_strncmp("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_strncmp("port", q, 255) == 0) { if (g_strncmp("ask3389", r, 7) == 0) { r = "3389"; /* use default */ } } list_add_item(self->mm->login_names, (long)g_strdup(q)); list_add_item(self->mm->login_values, (long)g_strdup(r)); } xrdp_wm_set_login_mode(self, 2); } else { /* Hopefully, we never reach here. */ log_message(LOG_LEVEL_DEBUG, "Control should never reach %s:%d", __FILE__, __LINE__); } list_delete(names); list_delete(values); g_file_close(fd); } else { log_message(LOG_LEVEL_ERROR,"xrdp_wm_init: Could not read xrdp.ini file %s", cfg_file); } } else { g_writeln(" 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_mode(self, 1); } g_writeln("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.x_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_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); } /* 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; } 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, 17, key_flags, device_flags, key_flags, device_flags); } } return 0; } /*****************************************************************************/ int xrdp_wm_key_unicode(struct xrdp_wm *self, int device_flags, int 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) { DEBUG(("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) { if (device_flags & PTRFLAGS_WHEEL_NEGATIVE) { xrdp_wm_mouse_click(self, 0, 0, 5, 0); } 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) { if (device_flags & PTRFLAGS_WHEEL_NEGATIVE) { xrdp_wm_mouse_click(self, 0, 0, 6, 0); } 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, 6, 1); } else if (device_flags & PTRXFLAGS_BUTTON2) { xrdp_wm_mouse_click(self, x, y, 7, 1); } } else { if (device_flags & PTRXFLAGS_BUTTON1) { xrdp_wm_mouse_click(self, x, y, 6, 0); } else if (device_flags & PTRXFLAGS_BUTTON2) { xrdp_wm_mouse_click(self, x, y, 7, 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->usechansrv) { 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, 0x5555, 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: //g_writeln("callback: frame ack %d", 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)); break; } return rv; } /******************************************************************************/ /* returns error */ /* this gets called when there is nothing on any socket */ static int xrdp_wm_login_mode_changed(struct xrdp_wm *self) { if (self == 0) { return 0; } g_writeln("xrdp_wm_login_mode_changed: login_mode is %d", self->login_mode); if (self->login_mode == 0) { /* this is the initial state of the login window */ xrdp_wm_set_login_mode(self, 1); /* put the wm in login mode */ list_clear(self->log); xrdp_wm_delete_all_children(self); self->dragging = 0; xrdp_wm_init(self); } else if (self->login_mode == 2) { if (xrdp_mm_connect(self->mm) == 0) { xrdp_wm_set_login_mode(self, 3); /* put the wm in connected mode */ xrdp_wm_delete_all_children(self); self->dragging = 0; } else { /* we do nothing on connect error so far */ } } else if (self->login_mode == 10) { xrdp_wm_delete_all_children(self); self->dragging = 0; xrdp_wm_set_login_mode(self, 11); } return 0; } /*****************************************************************************/ /* 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_mode(wm, 0); /* reset session */ } } } else if (msg == WM_PAINT) /* 3 */ { painter = (struct xrdp_painter *)param1; if (painter != 0) { 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, 30 + index * 15, 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); g_writeln("%s", new_part_message); 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; int 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_mode(self, 0); /* reset session */ return 0; } if (self->log_wnd == 0) { w = DEFAULT_WND_LOG_W; h = DEFAULT_WND_LOG_H; 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->monitorCount > 1) { for (index = 0; index < self->client_info->monitorCount; index++) { if (self->client_info->minfo_wm[index].is_primary) { primary_x_offset = self->client_info->minfo_wm[index].left; primary_y_offset = self->client_info->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 */ but = xrdp_bitmap_create(DEFAULT_BUTTON_W, DEFAULT_BUTTON_H, 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 - DEFAULT_BUTTON_W) - xoffset; but->top = (h - DEFAULT_BUTTON_H) - 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_message(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_mode_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_mode_event)) { g_reset_wait_obj(self->login_mode_event); xrdp_wm_login_mode_changed(self); } if (rv == 0) { rv = xrdp_mm_check_wait_objs(self->mm); } return rv; } /*****************************************************************************/ int xrdp_wm_set_login_mode(struct xrdp_wm *self, int login_mode) { self->login_mode = login_mode; g_set_wait_obj(self->login_mode_event); return 0; } xrdp-0.9.12/xrdp/xrdp_login_wnd.c000644 001751 001751 00000115520 13544635323 016652 0ustar00metameta000000 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" #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) { p->fg_color = wnd->wm->black; xrdp_painter_draw_text(p, wnd, 10, 30, "You must be authenticated \ before using this"); xrdp_painter_draw_text(p, wnd, 10, 46, "session."); xrdp_painter_draw_text(p, wnd, 10, 78, "Enter a valid username in \ the username edit box."); xrdp_painter_draw_text(p, wnd, 10, 94, "Enter the password in \ the password edit box."); xrdp_painter_draw_text(p, wnd, 10, 110, "Both the username and \ password are case"); xrdp_painter_draw_text(p, wnd, 10, 126, "sensitive."); xrdp_painter_draw_text(p, wnd, 10, 158, "Contact your system \ administrator if you are"); xrdp_painter_draw_text(p, wnd, 10, 174, "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; /* create help screen */ help = xrdp_bitmap_create(DEFAULT_WND_HELP_W, DEFAULT_WND_HELP_H, 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(DEFAULT_BUTTON_W, DEFAULT_BUTTON_H, 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 = ((DEFAULT_WND_HELP_W / 2) - (DEFAULT_BUTTON_W / 2)); /* center */ but->top = DEFAULT_WND_HELP_H - DEFAULT_BUTTON_H - 15; but->id = 1; but->tab_stop = 1; set_string(&but->caption1, "OK"); /* 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_mode(wm, 2); } } else { log_message(LOG_LEVEL_ERROR, "Combo is 0 - 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 * log_message(LOG_LEVEL_DEBUG, "domain contains _"); * 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_message(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_message(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_message(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_message(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 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(plain, value + BASE64PREFIX_LEN, base64_length); g_strncpy(value, plain, g_strlen(plain)); g_free(plain); } else if (g_strncmp(ASK, value, ASK_LEN) == 0) { /* label */ b = xrdp_bitmap_create(globals->ls_label_width, DEFAULT_EDIT_H, 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_label_x_pos; b->top = globals->ls_input_y_pos + DEFAULT_COMBO_H + 5 + (DEFAULT_EDIT_H + 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_input_width, DEFAULT_EDIT_H, 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_input_x_pos; b->top = globals->ls_input_y_pos + DEFAULT_COMBO_H + 5 + (DEFAULT_EDIT_H + 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(plain, value + ASK_LEN + BASE64PREFIX_LEN, base64_length); g_strncpy(b->caption1, plain, 255); g_free(plain); } else { g_strncpy(b->caption1, value + ASK_LEN, 255); } b->edit_pos = g_mbstowcs(0, b->caption1, 0); 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_strncmp(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 = g_mbstowcs(0, b->caption1, 0); } } if (g_strncmp(name, "username", 255) == 0 && self->session->client_info->username[0]) { g_strncpy(b->caption1, self->session->client_info->username, 255); b->edit_pos = g_mbstowcs(0, b->caption1, 0); if (b->edit_pos > 0) { username_set = 1; } } if ((g_strncmp(name, "password", 255) == 0) || (g_strncmp(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]; char cfg_file[256]; struct xrdp_mod_data *mod_data; 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; g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); fd = g_file_open(cfg_file); /* xrdp.ini */ if (fd < 0) { log_message(LOG_LEVEL_ERROR, "Could not read xrdp ini file %s", cfg_file); 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)) { } 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_item(mod_data->names, (long)g_strdup(q)); list_add_item(mod_data->values, (long)g_strdup(r)); } list_add_item(b->string_list, (long)g_strdup(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; } /******************************************************************************/ 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_x_offset; int primary_y_offset; int index; int x; int y; int cx; int cy; globals = &self->xrdp_config->cfg_globals; primary_x_offset = self->screen->width / 2; primary_y_offset = self->screen->height / 2; log_width = globals->ls_width; log_height = globals->ls_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->monitorCount > 1) { for (index = 0; index < self->client_info->monitorCount; index++) { if (self->client_info->minfo_wm[index].is_primary) { x = self->client_info->minfo_wm[index].left; y = self->client_info->minfo_wm[index].top; cx = self->client_info->minfo_wm[index].right; cy = self->client_info->minfo_wm[index].bottom; primary_x_offset = x + ((cx - x) / 2); primary_y_offset = y + ((cy - y) / 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_sprintf(buf, "Login to %s", buf1); set_string(&self->login_window->caption1, buf); } else { /*self->login_window->caption1 = globals->ls_title[0];*/ g_sprintf(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 */ if (globals->ls_background_image[0] != 0 && self->screen->bpp > 8) { 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_message(LOG_LEVEL_DEBUG, "We try to load the following background file: %s", fileName); xrdp_bitmap_load(but, fileName, self->palette); but->parent = self->screen; but->owner = self->screen; but->left = self->screen->width - but->width; but->top = self->screen->height - but->height; list_add_item(self->screen->child_list, (long)but); } /* if logo image not specified, use default */ if (globals->ls_logo_filename[0] == 0) g_snprintf(globals->ls_logo_filename, 255, "%s/xrdp_logo.bmp", XRDP_SHARE_PATH); /* 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); xrdp_bitmap_load(but, globals->ls_logo_filename, self->palette); but->parent = self->login_window; but->owner = self->login_window; but->left = globals->ls_logo_x_pos; but->top = globals->ls_logo_y_pos; list_add_item(self->login_window->child_list, (long)but); } /* label */ but = xrdp_bitmap_create(globals->ls_label_width, DEFAULT_EDIT_H, 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_label_x_pos; but->top = globals->ls_input_y_pos; set_string(&but->caption1, "Session"); /* combo */ combo = xrdp_bitmap_create(globals->ls_input_width, DEFAULT_COMBO_H, 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_input_x_pos; combo->top = globals->ls_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_btn_ok_width, globals->ls_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_btn_ok_x_pos; but->top = globals->ls_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_btn_cancel_width, globals->ls_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_btn_cancel_x_pos; but->top = globals->ls_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; } /** * Load configuration from xrdp.ini file * * @return 0 on success, -1 on failure *****************************************************************************/ int load_xrdp_config(struct xrdp_config *config, int bpp) { struct xrdp_cfg_globals *globals; struct list *names; struct list *values; char *n; char *v; char buf[256]; 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->ls_top_window_bg_color = HCOLOR(bpp, xrdp_wm_htoi("009cb5")); globals->ls_bg_color = HCOLOR(bpp, xrdp_wm_htoi("dedede")); globals->ls_width = 350; globals->ls_height = 350; globals->ls_logo_x_pos = 63; globals->ls_logo_y_pos = 50; globals->ls_label_x_pos = 30; globals->ls_label_width = 65; globals->ls_input_x_pos = 110; globals->ls_input_width = 210; globals->ls_input_y_pos = 150; globals->ls_btn_ok_x_pos = 150; globals->ls_btn_ok_y_pos = 300; globals->ls_btn_ok_width = 85; globals->ls_btn_ok_height =30; globals->ls_btn_cancel_x_pos = 245; globals->ls_btn_cancel_y_pos = 300; globals->ls_btn_cancel_width = 85; globals->ls_btn_cancel_height = 30; /* open xrdp.ini file */ g_snprintf(buf, 255, "%s/xrdp.ini", XRDP_CFG_PATH); if ((fd = g_file_open(buf)) < 0) { log_message(LOG_LEVEL_ERROR,"load_config: Could not read " "xrdp.ini file %s", buf); 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_message(LOG_LEVEL_ERROR,"load_config: Could not read globals " "section from xrdp.ini file %s", buf); 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); /* login screen values */ 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_width = g_atoi(v); else if (g_strncmp(n, "ls_height", 64) == 0) globals->ls_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_logo_filename", 255) == 0) { g_strncpy(globals->ls_logo_filename, v, 255); globals->ls_logo_filename[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_logo_x_pos", 64) == 0) globals->ls_logo_x_pos = g_atoi(v); else if (g_strncmp(n, "ls_logo_y_pos", 64) == 0) globals->ls_logo_y_pos = g_atoi(v); else if (g_strncmp(n, "ls_label_x_pos", 64) == 0) globals->ls_label_x_pos = g_atoi(v); else if (g_strncmp(n, "ls_label_width", 64) == 0) globals->ls_label_width = g_atoi(v); else if (g_strncmp(n, "ls_input_x_pos", 64) == 0) globals->ls_input_x_pos = g_atoi(v); else if (g_strncmp(n, "ls_input_width", 64) == 0) globals->ls_input_width = g_atoi(v); else if (g_strncmp(n, "ls_input_y_pos", 64) == 0) globals->ls_input_y_pos = g_atoi(v); else if (g_strncmp(n, "ls_btn_ok_x_pos", 64) == 0) globals->ls_btn_ok_x_pos = g_atoi(v); else if (g_strncmp(n, "ls_btn_ok_y_pos", 64) == 0) globals->ls_btn_ok_y_pos = g_atoi(v); else if (g_strncmp(n, "ls_btn_ok_width", 64) == 0) globals->ls_btn_ok_width = g_atoi(v); else if (g_strncmp(n, "ls_btn_ok_height", 64) == 0) globals->ls_btn_ok_height = g_atoi(v); else if (g_strncmp(n, "ls_btn_cancel_x_pos", 64) == 0) globals->ls_btn_cancel_x_pos = g_atoi(v); else if (g_strncmp(n, "ls_btn_cancel_y_pos", 64) == 0) globals->ls_btn_cancel_y_pos = g_atoi(v); else if (g_strncmp(n, "ls_btn_cancel_width", 64) == 0) globals->ls_btn_cancel_width = g_atoi(v); else if (g_strncmp(n, "ls_btn_cancel_height", 64) == 0) globals->ls_btn_cancel_height = g_atoi(v); } #if 0 g_writeln("ini_version: %d", globals->ini_version); g_writeln("use_bitmap_cache: %d", globals->use_bitmap_cache); g_writeln("use_bitmap_compression: %d", globals->use_bitmap_compression); g_writeln("port: %d", globals->port); g_writeln("crypt_level: %d", globals->crypt_level); g_writeln("allow_channels: %d", globals->allow_channels); g_writeln("max_bpp: %d", globals->max_bpp); g_writeln("fork: %d", globals->fork); g_writeln("tcp_nodelay: %d", globals->tcp_nodelay); g_writeln("tcp_keepalive: %d", globals->tcp_keepalive); g_writeln("tcp_send_buffer_bytes: %d", globals->tcp_send_buffer_bytes); g_writeln("tcp_recv_buffer_bytes: %d", globals->tcp_recv_buffer_bytes); g_writeln("new_cursors: %d", globals->new_cursors); g_writeln("allow_multimon: %d", globals->allow_multimon); g_writeln("grey: %d", globals->grey); g_writeln("black: %d", globals->black); g_writeln("dark_grey: %d", globals->dark_grey); g_writeln("blue: %d", globals->blue); g_writeln("dark_blue: %d", globals->dark_blue); g_writeln("white: %d", globals->white); g_writeln("red: %d", globals->red); g_writeln("green: %d", globals->green); g_writeln("background: %d", globals->background); g_writeln("autorun: %s", globals->autorun); g_writeln("hidelogwindow: %d", globals->hidelogwindow); g_writeln("require_credentials: %d", globals->require_credentials); g_writeln("bulk_compression: %d", globals->bulk_compression); g_writeln("new_cursors: %d", globals->new_cursors); g_writeln("nego_sec_layer: %d", globals->nego_sec_layer); g_writeln("allow_multimon: %d", globals->allow_multimon); g_writeln("ls_top_window_bg_color: %x", globals->ls_top_window_bg_color); g_writeln("ls_width: %d", globals->ls_width); g_writeln("ls_height: %d", globals->ls_height); g_writeln("ls_bg_color: %x", globals->ls_bg_color); g_writeln("ls_title: %s", globals->ls_title); g_writeln("ls_logo_filename: %s", globals->ls_logo_filename); g_writeln("ls_logo_x_pos: %d", globals->ls_logo_x_pos); g_writeln("ls_logo_y_pos: %d", globals->ls_logo_y_pos); g_writeln("ls_label_x_pos: %d", globals->ls_label_x_pos); g_writeln("ls_label_width: %d", globals->ls_label_width); g_writeln("ls_input_x_pos: %d", globals->ls_input_x_pos); g_writeln("ls_input_width: %d", globals->ls_input_width); g_writeln("ls_input_y_pos: %d", globals->ls_input_y_pos); g_writeln("ls_btn_ok_x_pos: %d", globals->ls_btn_ok_x_pos); g_writeln("ls_btn_ok_y_pos: %d", globals->ls_btn_ok_y_pos); g_writeln("ls_btn_ok_width: %d", globals->ls_btn_ok_width); g_writeln("ls_btn_ok_height: %d", globals->ls_btn_ok_height); g_writeln("ls_btn_cancel_x_pos: %d", globals->ls_btn_cancel_x_pos); g_writeln("ls_btn_cancel_y_pos: %d", globals->ls_btn_cancel_y_pos); g_writeln("ls_btn_cancel_width: %d", globals->ls_btn_cancel_width); g_writeln("ls_btn_cancel_height: %d", globals->ls_btn_cancel_height); #endif list_delete(names); list_delete(values); g_file_close(fd); return 0; } xrdp-0.9.12/xrdp/xrdp_logo.bmp000644 001751 001751 00000304766 13544635323 016202 0ustar00metameta000000 000000 BM6(  ryxsn2( {urmeS {urolc/~zurolh^.w#& }tpolhd]E8)%!2Mrg7|okhe iWog**3jA ng ic_V*1?lrcb_Y(nG5Fv h`_\Nz3Add^\V YEdlV7zuTNwv逤bax졸Br+_ QNG@ J\}`Rcz9_:g9j=r\E>.<[LvJd;]'P1['UFoM4Z*&Wj~UObJ_=4_(Y-\1a:g?g5-YT`6R+^9sY'i#eBz0k Y% QLU8o"rLnqL"t@mL qv{s;JPz,FF, Osh,z~]¿%@AM+"4Q"y=]FN,JPQD3Bq uȴh"Σdv$krdWE HܰhwGCEwzFCBBkԌɀsrr~ƉʝֱKCALϪʎv^OEABHWpԔX' &)-86:??EFGGMc†Χ?oBAKӴŇY2`- "$&+8AUiƎΗјҔҐЁqc^Z^w̛uyBDJېΪv@ Lk  3^ڂjjɅҭD F@aսŌM  vyPx΅Ԧ J?<6^Ѱz7  !&(',1% || ~ bՉլ#YK'YYuұy4&0>]ߜi?]lrzy{{Kښ|z}Ǻ̈B0>c؏T@uuww ~|љZ%Acٕ" !|tuur9ҭ|4+Oz qo vtnUɖXݛ$Qπu tio sl^ؽÇFەGmjlp+9߁dill\Ӯr99vF3LQcߙ^ghgHΦc%XӐ_>:Jc -[dfd!y̡Y*qܪ= ?F׮f _&n_cdb̡X ;ψ8>Hג] $lژV`b\RΥQFԘ5:B|N-Ie\__iұRлPڢ9:91XS/rؙR[ _XK# @ܮTz;5'Q1_>wUZXWΨ9 /٤h65$OV?ݲ^RWUfH ҕ|55 L5jӐPSURJvw45IճHdCwKRTQϩ& N36FբzO+eLRSRR 'ߵ֜tщ26CՒdةXMQQ[ő̅ڥ,16@ԅhrӔ QMOO*h[ L伵 16=xo_΅MLOJ?wҭ^ګ䵜 86 ;iMxIKNJSڄǂM hC5 9[yAnHJLGaڍȓ0)˹L۪"M57Zpo;iGGKDgܒXlӐl-Z65Kiaщ$ o7fDFIEhܑЦ-ߨ/سֵ+UzC2Bbf#ܧ$8gDDHCeَx e![}13:]m}ͼSq֗:gBCFB]׈ܿN*מuԒEj457\sǵͼSBl@BDAN}Ϟ) QзʺPݨyg'ܦȵBz⵺*ʵ,ƵHiA=>awgŲ:ξYȶDodƴ>˹MŲ:Ͽ\İ6߯®/ϾZיϿ\İ6߯®/ϾZיmɷGϿ\ȶDǴ@ٞgŲ:ξYȶDoɷHξYmު'νWۣϿ\İ6߯®/ϾZיǴ?]̻RLr@BCAAqyȶƳ> ̵{z㹵wȶDǵAɷG `ڡ赜b|wyHena8[|]ךξY] 㹵΂Ͽ[ı7ʸIϿ[ı7ʸIh­.k]ךξYٟެͼSİ5Ƴ=Ͽ[ı7ʸIİ5zỤZzB>B?0dY4ݪrɷG˺OͽUʹKʸJ]ɷHϾZܦyҍZ}9rtL:aיъnҌjיъnҌjᴵ˺OjЈeיъnҌju΁ڢjˇD<A? PR ]rkyξYiξXgͼT㵜+\1 7ǭ ̽b߱౵˺NصʸJеİ6صʸJеİ6絜~ȵ(صʸJеİ6˹L徵gϖL9@>6{oű8亵΁ͽV­.&ʸIZ}22~U˺O߯˹L))ȵBǴ?ڡ˺O߯Ǵ@')Ǵ?,֯*]4?A ?p1~fzݩ̵#vవɷF\~22^mj˵]ƴ>֖Ƶa_ͽUf_ͽUf߯τ̻Rn˵]ƴ>֖̻PdެЇj_ͽUf߭İ6y͞Aq4<?IP|İ6Ƴ=ı7ï1ƴ>䶝ܵ[~22Pe)ъŲ:ı7΂ _ݩqЈ'ӎݩqЈ'ӎj鵜Ƴ<ъŲ:ı7τı7ڵİ6ݩqЈ'ӎ̻RǴ@ƴ>EKʗZȀ79==4clg˹MeϷϿ\ϾZІЈ0_22Rg׮ȵB̻R˹Lެ߯Ʋ;˺Nƴ>fdƳ<]]Ͽ\­-ddƳ<]]Ͽ\­-d߭˺OcƳ<ǵAȵB̻R˹LެǵAۣξX'ޫdƳ<]]Ͽ\­-dvǴ?̻Qe۴75ڿvˑA5=:RݠՓ ݨei߮Ԓb˺Oƴ>υ"ۤ㹵ʹK ı=[:2|}Z!֢뵜˹Lԡ0΂Ѥ*T/<: F\Ҁf­.Ӑ ­.y^˺O뽨y&Ԓڠ^fyyE+s֗ï1 kךЖ ٘پJj18:>5c̻RޫͽVaЇ˹LjʹKۤb˹LɷGİ5ҍɷHh3BYAgՍڡ͈ߩmȅ 92::P{ٗ亵ыIJAj322WԃǵAyѤ%M/@< CDoɷF?g325YՄР>!!'eڡ Om469;$Rhզy7d43=]zٰs̄Ջۏъˊ+٘yʏ=088BEr޵ޫ-[44Gd{հnu~ӈ׍֋χ zlw(׷4V/57<O߫˺NϾZ,W46Rku~r-]m z݅ގ ӁmcWˣ~g7389 @Hoȸ L <7\sf„ЪFXւ  fOZ ձ(N168:FݤȶDܦ =9Aa|Zk=҂U:b| 6368;EnǴ@47CzQfY  Ј4մ(L26 ==GpՌƲ;1:E{Ruk 7mɄA:57BLdў29?Ջj_ʥ hC4W 845A9=gϿX36CԕLqǝT nj ϛA64@6;e҆c36FԤBʸIϾZ̻Q­.Їъ)]`ު'̻RɷH]Ͽ\˹MnɷHξYmкЯ/vYu:3 =83Gۡҍlj45IԶjEƳ=΃|Ƴ<еvֶ®0Ʋ;ξYՓ ٟެͼSؑǸֽ@ ̫{۾8[< ;674&U˼Vu55!L<_x"ݨ仵b̻P̻P|"ܵ˺Oᴵ˺O2ٿY=MԺxѠ*M@3556;e͏]75#Ou/`]赜*ҍՕЇɷG ͼS絜~q! ;ẗ+O 82649KqsZik4(R:?ܦï2ʵνW㹵 bǴ@5,+gȀG5373:Ry&VouRipX8\e)j굜iщq |؛o̻߯P[)4߉TrE4363=Uv @;}@"ڠՓ+1ï2ҍʸIֵű8ȶDֺï3ı7τ'>!0۶OpF1372@O{5: =ϙK Ƴ<ɷG_<'axɷHיϿ[®0㸻Ͽ[he˺OǵA|>-q١؝QqF2494:Cm6: ?}ҍ zR%,徵 뵜˹L8 ٯUsH239555a۝8:C՘ЈͼS`^y ï1 ݇4ڲ^y"K12962 UgՊv::Gմd!Eƴ>­.νWڡTO޸j˃+S139:6 GLuߣNz47IZ/]zϐ:`439;9;*^~rQ(S@^ЎԡOo >27=;9HdյLۦݵl̄#Q05<=<?"[M{gڏգK|/o%n3pO}֪F &$NjՠNl<2:@ EDFT;n^ىZx A>FJG<Ib|\ | |J~ӣֻܐ1[87> FF>CQ-g@t^t.4;@CA:30ewH yz{||'T}=he̦ٓߵ^̀N2>DACCA굘.%.48895,( {)U"twvwxv5: 0 H?IBfџܲ\~R::>%^_lh(;BCCDB:|%n\g{{hQ<+~tjm trsuuq )drwB G?Chةe҈R=m׳CNlDTUVUVUSFf%s0 j cdcacei oknqqlb>&7O}ndd}w HBBqAA>      c݀݀c>px$ll$   >c݀Հc>``   ``@|t@ @@@ppllؐ  ABB` 0  ABB @1  b` 0  @p  ""AA  ""AA  ""AA  ""AA  ""AA  ">AA   #>BB ""AAxx|t  ""AAH0x|t  ""AAx|t  AA>0H|̄|L8 $>AA>H0|̄|L8 >AA> |̄|L8 >AA> |̄|L8 $p .1!!!!!  @@@@@@@ @@@\bBBBBB    p p 0p p ` @ @@@@@@@@@@@@@@p@@@~@@@@`@@@@@  Ą Ą  $H0Ą @@1!!!!! Ą8 <BB< xȀp  ~C@@@@C~        >~~||̄|x̄hx >  x  ?AA>BB$$$$  ` ``@@@@@@@@ ఘ`@@@@@@@@@@48X<$$FB  ````````w  0@0@(@$@&@"@!@ Ą @ ~y рp̄ 8fx@@~ppp`0 @p|@@@@@@@80~0@@@@@@@@p  @<t BBB< |  ÀD@(@(  DH(00 `  ~0 @x` 0< @ @ 0p8 pxp 0`  @@`0Ć   (| @| P | @̀|   `  @@@@@@@@@@@  @@@@@@@@@@ Ņ  ""AAH0x|tP P  $BB  {`  q  >AA>|̄|D8  >AA>`|̄|L8$p "$(0($" AA> @|̄|L8   Ą  ">AA2LH0x|t   #>BB  {`  q =BB @|̔  (""AAP(x|t  ""AApx|tP((x̄8$8x̄8P P`@@@@@@@@@@@@@@@@ (dHP``|@@@@@@@~   ,Lp   @`0< p@@ ~AAA~AA~  @@@@@@a?  ""cAA@x|@ p @@@@@@@@@  =CC=|̄||BBBDBBAX`@@@@B$BFd(0`Ąx|̄|̄p̄pȀx@|̄| |̄|x̄xxx  x 5Āxxpxppp  p qp  xrx  <D|  D$ 4D  ||p0 p pȀ` p   @w  @0t0   @w  @@DDC@@@@?DDDDDDD<   @@LHHIN?  8 `l@l@l@l@l@l@@@༆ tlHth@`bbbbb">  @`bbbbb">𐐐@@@@@@  tlHP` @@@@@@ @@@`@@@ ```PP` ```@@ @  @@@@@@@@ ```аP 0@` ```@@@`P`@pȀpHH@@@@@@  @""AA  @  @@ @ @ @? @ @ @ @@   @!@@@@@!  @ @@  @ @ @ @ @9@`  ""AA   ""cAA  @  II>B$$B  ɀk> xx000~@@x |p 0  `BLt @@|  8!#&$0(T  @@@@@@s  ݀w  cÃG{ d|   >FN2 >c ``? x0`D8 $<<$B4<& |Ƃ|px ,(8HȎ|Dĸ`<pȀp@@@@@@@@@@  fC>xx ̄ AA> |€||@@@@@@@@@ ?!!!!!!A    Ȅ $DD,(8`   ""AA    ?!!!!!!A b02`' " B |x  $ Ȅ ?!!!!!!A    II>B$$B  ~     ? ?    ||    ~~"bBx|t8@̄x >""""Bx̄8  D@$?$D@`pppH0𐈌>""""B ƪx̄x̄pȀp DD((  ɀɀD((D |   @@   pxp  ||dD x̄8(x̄8````|bbbb pȀpppp@@@@@@@@@@@@@@@@@  >""#" B  @@@@@@@\bBBB 𐈌 $DD((    @@@@@@s  Aw   >!!>  `    ??d@D`  1/DD@`ɐوш  @  b&4<zHx0  @ǀ@ 0  HPp8 tP`p@  `LLm--  D`Dd%%5  fC>xx  Ac""6 CFd$,8  Ac""6  CFd$,8  0X @Ȁp  t@s  @@```@d ~Á~@ px  @ q  ?@@@@@@s  >*Aـw v`>xx8t0x 8$ `@<$ 1 ``  $À H8 ``|gaac~@@@@|BB|Ą̼ ? >   0c30`0#cC   d@4&d@D  |x pppp p ؈   clxtfbaa@@DHPxlDB  `    À    00  ````@  vK>xx 22"""     À  ~|   ҀԀԀ̀@    ""AAH0x|t  ""AA0x|t   #>BB  {`  qH0H0x̄8 x̄x  fC>(x̄x (||Ppxp<DD,(8`<DD(( DD,(8`DD(( (DD,(8` DD((  ~(| ``    ? < 8> < 0 c2&cAF$8dB  c2&cAF$~8dB >憆~   > `{    p@8@@@@@  p p8p  11!  >22 " " "   @@@@ sC> |x    |p|xpx ?#####cC >222""  B@<@ >Á  >?    >   B|0LĄL4   >Á  8f@@  @@F<    @?P0` ` ` `0@ f: 0`0LĄL4L  <  @AAAAc?  @B| 8~  p  ` 8`B| <Á 8f‚ px ~ۙ0LĄD$  >  <  f:@@ |€|| >Á 8Ƃ<~   >II>  3!1!  0 @@>0 @@> @ ddlx@ddlx0lx0lx  !&,@8  $!&,@80``~@0``~  @`  p   x<$ |`$4 8 8(@@@@@@p@@@@@V^| 0@@`xpPpDD(((88((hDD @H @ pP  @@  p  @@  @@  @@  @@  @@  @@  @@  @@00@0 @@>0 @@>0 @@>0 @Ȁ@>(0 @@>0 @Ԁ@>0 @Ԁ@>     `  @`  `      x |0 @Ԁ@>$4 8 P`8`@@@@@@p@@@@@V^| x@@@@@pPp@@x0`@DD(((88((hDD  " |~ |,4 ~8Ǝ b| |@촄 !9)9 R """‚|‚| ƒ ⒒ B B !!!!! b| ¢|~Cs[knxx  gcs[kn  Dxx| ||  0XǀY#  ||p  rN  P( 8(xX0 8(8@@p0 0(8 Ĥ|x̄xd0`x   ####0`>`>  = """ 򒒒Ҳ  D{  D{  AAc""   ""cAA  ""cAA  ""cAA   (  aa aa   1   AAc"`"   1   ""`cAA   1   ""`cAA     `     `     a`a      a`a aa 0PP0 @@` `@ @`(HPP@@@@@@@AAc""  "@"cAA  @ @ 0aa  AA""   ""cAA  ""cAA  ""cAA `` `` (`` `a` `` ``  @@@@    AA"`"   1 @@  ""`cAA   1 @@  ""`cAA       ```       ```      ```      ``` ``pp <  <Á <Á <Á    a ?@@? ?@@?  @ @ @ @@ @ @0  <  0 @ @@ @ @ @ @  <  0 @ @@ @ @ @ @  <  @ @    @ @      ?@@?    ?@@?   pp  @@@@@<  <@@@@@  @@@@@  ?@@@@@@@?x̄|$x̄x̄x̄|̄x|̄x |̄x̄x̄x  ـ  x̀| 3!!>  x̀ 3!!>  x̀  ـ  |̀x  ـ  |̀x >!!3  ̀x >!!3  ̀x @|fB<0Аp yͅ|  x̀̀ }̈́x  ̀xx̄$x̄x̄x̄xx xxx    x 3!  x 3!  x    x    x !3  x !3  x @@@@<$  ?   ?   ?   ?   ?   ?   ?   @@@@~xx   @@@   $$x  x  x   @@   @@   @@  x  x   p@@  ـ  x̀ ـ  x̀  (x`|p$$  @@@  $$`  `  `  @@  @@  @@  `  ` 0  p@@   0`   0` 0  @@ @0  @@    `0    `0@| ><@` `@`@ `@   @c 8   8     c@   c@ 8   8   @p 0`p`  0X    Hx   Hx  xL` B`!  xL` B`!  !B`F L`x  !B`F L`x  2 `  0X`   ` 2   `Hx  ` 2   `Hx 011pxLl B`! 011pxLl B`! pИ10!BlF L`x pИ10!BlF L`xL @H0@  @  @@  @ @ @   @  @     @ ?  @   ?  @@     @     @  ?   @ ?   @ @~ 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  s` t ` s` t ` s` t ` p s`  ` @p s`  ` tw`  ` tw`  `  tt  x  P00  x  00P$`xz `xz `xz   ` z   `  @` z   ``z x`z x `z  bP   `  `  @@0  @@0  `  `@| @ ``` ```@` @` ``@``@@8 ̄  ?aa? @P @`` s` t ` `ff>&FFFF&>ff>x   @@@DD((  IUU"" @ 0((DDD >""""B 0PH0P\ ` 8DD8@@@@@@計аЀ0LD8hHxx `Zjf$p`pp` ~`p`pp` `pp  𐐐p``pp@@@@`pP` ࠠP` 0@ppxp P` `PP` ࠠP` 0@ppxp P` `P|Ć̸@@@@`@ppppPPp` `@@@@@@@@pp@@@@@@@@@@@ pHHHаppp pp @0`@@@@@@@@@` pPp ࠠ PPp @p @p pp ppPPp  ""AAx|txHx ̄ ̄  x̄x AA>|̄|L8 Ą Ą  @@@\bBBBBB  @@@@@@@@@ @@@@\bBBBBB@  H0Ą`@@@@@@@@@@@@@@@@@@@ <x @@@@@@@@~@@@@@@@@@@@@x@@@@@@@@@@@0H@@@@@@@@@@@`              Ą Ą  <Ąx $Ą0H  @ P@@   Aw  Aw  Aw  4,Aw  4,Aw  @'@     @  @!@@@@@!  @'@    @@  @ @ @ @ @9 |PАP<  `x@x8{Hx  `x@xx{H`8x b`> ad xx?  @xA`z @xAzHHHHx|p| ||  gd  h`H@H@@p`   "-0  〢 >"bBBBF ~ ~bBBFDh 08   @(0PP``@@  HHOHH@H@H@HO ɩ qqyi0mHeHg0cx  >AA> FJqBb  fe6  iHH  p  c   @ € w '(@(@.@(@' OII  Is2"64\H  (HP x0@x   AA  !! r@|  @@?8D8D@@0@|   | 0(`   " 8p cuc  xx p ppppp  ~D((  55553      H$  $H 8΃|<$B  R }|ļ0P````(000PPP`  y0xLG  ABB  1  "b  1  ABC   1  "c   1  b   1  1Q   1  ABB  0    0  ABB @  1  b @  1   @  1  !!BBE @  1 ABB0  @@  AA""  A@A@"@"@@@@ ȀAHAH"H"HHHHʀAJAJ"J"JJJJ   B$$B  @B@$@@@@$@B@@ HBH$HHHH$HBHH  @  @ ࠀ `      `  1``0  r""""*'  0``1  @@@`  "w""""""    """"""w"  @  @  {  w  1o   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;  '/*""""r    DD    IK  JJ  *))+(  uW4  `  ~  a@@  A""60HxpXh`$$D@  ?CA  6"cAA  ACb"4  ?`@@`?  ?bDHx? ~@@>         @ 0 0`     @@@@`  8|``H(00<<H(00 &>H(00 tT  ff   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       @@@@  $  $    "  "  $  >  ~n  6***   `@      xx  <<    <<0  0 `99p 9p`9```𐐐p```    x   <  |    <  x  <  |    <0  <  xyx  <  |yx   x  `80`  x  08ǀ`  xx  08x   x  d80`@@  @@?    DH?   0  ?@@    ?DH     ?@@   x x x       >II>  >AA>  >AA>  >AA>  >AA>  >AA>  >II>  >AA>  >AA>                         a9   @@  @@    @@@@@@@@ BFd$,8 8($dDF BFd$,(   "B  1! @@@@`  @@@@` 1   >A  A>00HHHP00@`   ` `  ``  ``   1``  ` 1``  `1``  0  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 @ xld hȍȰh۶vn΀  H@00`H0  ec`x̸̄  Aw r΄v  !!? 0  x  ? @@@ @@@@  `@@@@@@` @@ 0 @@ 8@ 0 @x   @x@   @@?@@@@@?  ?  ic  ? @A  8/1!!!1.  3Ȁ@@@A>  3܀@@@A>  3܀@@@A>  3Ā@@@A>  3ހ@@@A>  3΀@@@I>  3^@@@@@?  3̀@@@I>  3̀@@@A>  3Ӏ@A>                   00000  K@K@K@K@K@K@  {{@@{@@{{@                  @@@@@@@@  @@@@@@@@  @  @@@@  @@@@@@@@  @@@@  @@@@@  @@@@@  @@    @@@  ??  ? @A  ??  "!A@08x|0HH       ??  @@!! |x80HH0  ??  @ @0@@ @@@ <<  4$  @  @@@@  ??  !@@@!  -^@^-  >M@@@\#00HHHP00  >A@@@@#  A@@@@  >UՀ@@@ՀU7  >A@@@@#    >y@@x;  >GG'  >@@#  >A@?  >G@@#  >G? 8xx8  @@  @  @0@` @   >A@@  @@#  @?    ?@`  @@@@@@@@   @@@@@@@@   @@@@@@@@  "-A@  99xx  &'GG 0@@ @ `  @@@@@@@@  @@@@@@@@  @@@@@@@  @@@@@@@  >I@@@#  >A@@H+  >A@H+  >I@@#    @@@@@@@       @@@@@@ @@@  ).#@  ??  ?    R !  `   ?2!  A"">! @@    ?@@@A>  〒@@  〒@a> <|x    " p?d;?0;x>?$k\7LLG  @@@@@@@  @@@@@@@  @@@@@@@P` P  @@@@;@  ?  a  ?   i{k  }    x   04䄄  |t  AA7݀_̀  ?0 '<  ?c@_>  "!!?ր.@ s |xTxX00 8((0 V<88|V p  @@  >``p  k@@ ֺz8   #|@@  ?I@@ii  @@          {{T^k{  ?A@@ba  ?A@@La  ?̀߀a  ).+@ p(((0` 8`P8xHx x |‚|< <|‚l  ?@FF< zʆ  HD RR~RR8( 8WRV<8  @@@   @!6!!!#  """""">  ?Xw~ ""bH  JJK@K@J@J@JJ  "!"  [mIIIIIIH`  @>@@ @"@  XXh('   D$$$$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<~~<  >"" {  8V4,ˀ@? ,$  &"""""b    Аࠠ  ` ~   >M7•@~M2  "EĀ@  "EȀ@  "M€@  " Uހ@  "]€@  "]Ԁ@  "EĀ@  "A@  76a{?  ?i逞@H  @ဿE>  @A> `@@0x        ?@@@A>  ?@@@A>  ?  ?         p~~~~  sa@ q   ?Ȁ? BD(8nv 8``8`0   sb@@  O@@ <$$v8  aH@As ( 8(zj8 ۽|(  *)A@ 0``  6I$$>$   ?LL@@L?  ?LL@L|  8LDxx 8px  w{t>"B"6> 8X|8DD8  0M@x x̄x xx `` ||  뀜H  q  ~~ pPЈPP  |‚|  p0  f  BHp  `~a@  cQ>  c€A>      а  >IXt pj6   @ +Vp  |   @  \xp` l88lƂ  "w>>c f,88h |x8|̀  <,뀈o,        x̂HHH8 xXXX8  >ɀ>  cBc  ɀ  ɀɀ    <Kk  >  "C4  @!!${  w瀀Àɀ]>   s!!  ^//${   w.+1   {%!   '+1   !#-;0  Y>  6$wɀ  I**I  %5  k^nvVy  I>>  J>>*I  {>>~I  *>>*  ,]>]*  ɀ  ɀ  \  ]  Ccv  $]Iv  Հ^  w݀݀~  T  >kk  >k*.  IIˀ_  ˀ  I*<*I  ]2݀,*]  K*${I  k*<kI  <C@@@@  @@@@@@@  @@@@@@@@  @@@@@@@  @@@@@@@@  ?o   @@HH ~|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߀K>  ?a>  ?s>  ?y|t?  ?o@@@Ā>  $\@ @_@   ,S@ @_@   .S@ @^@   "F@ @B@   >P@ @^@   &X@ @N@   ?A@ @H@   .Q@ @^@   ,[@ @^@   3T[@   ;k{`?  3lwh?  1l~a?  =}}}?  !o~a?  9gnq?   ~{w?  1nna?  3d~a?  .m@o@D@?   `0   0`          //  ..    @80  @8"\  @p<??<p@           ~@@@  @@@@?@ 䂃     ~ ||   0x8  y 8x0  x8   8x    b  y  }  xz 0(HDHH00𠠠PPPPPPPPPP @@@@@@ @@@ @@@((PPPPPP((PPP((PPP  6wՀՀUUUU  UUUUՀU6  @\@8 @@  6EG@CAb> %DDD% @@ 0``0@@WW                                                                                                                                                                                                                                                                     8|TTTTT TTTTTT8  >MEAAc> >YQAAc>  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  #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_term_event(void) { return 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("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) { g_writeln("unusable int size, must be 4"); return 0; } if (sizeof(long) != sizeof(void *)) { g_writeln("long size must match void* size"); return 0; } if (sizeof(long) != 4 && sizeof(long) != 8) { g_writeln("unusable long size, must be 4 or 8"); return 0; } 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(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(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("/dev/null"); g_file_open("/dev/null"); g_file_open("/dev/null"); /* end of daemonizing code */ } if (!no_daemon) { /* write the pid to file */ pid = g_getpid(); fd = g_file_open(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.9.12/xrdp/xrdp.ini000644 001751 001751 00000012435 13601646134 015144 0ustar00metameta000000 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 ; ; 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 (for experts) #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 ; 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 #require_credentials=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 ; blue=009cb5 grey=dedede #black=000000 #dark_grey=808080 #blue=08246b #dark_blue=08246b #white=ffffff #red=ff0000 #green=00ff00 #background=626c72 ; ; 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=009cb5 ; width and height of login screen ls_width=350 ls_height=430 ; login screen background color in RGB format ls_bg_color=dedede ; optional background image filename (bmp format). #ls_background_image= ; logo ; full path to bmp-file or file in shared folder ls_logo_filename= ls_logo_x_pos=55 ls_logo_y_pos=50 ; for positioning labels such as username, password etc ls_label_x_pos=30 ls_label_width=65 ; 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=220 ; OK button ls_btn_ok_x_pos=142 ls_btn_ok_y_pos=370 ls_btn_ok_width=85 ls_btn_ok_height=30 ; Cancel button ls_btn_cancel_x_pos=237 ls_btn_cancel_y_pos=370 ls_btn_cancel_width=85 ls_btn_cancel_height=30 [Logging] LogFile=xrdp.log LogLevel=DEBUG EnableSyslog=true SyslogLevel=DEBUG ; LogLevel and SysLogLevel could by any of: core, error, warning, info or debug [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 tcutils=true ; for debugging xrdp, in section xrdp1, change port=-1 to this: #port=/tmp/.xrdp/xrdp_display_10 ; for debugging xrdp, add following line to section xrdp1 #chansrvport=/tmp/.xrdp/xrdp_chansrv_socket_7210 ; ; Session types ; ; Some session types such as Xorg, X11rdp 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 ip=127.0.0.1 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 [vnc-any] name=vnc-any lib=libvnc.so ip=ask port=ask5900 username=na password=ask #pamusername=asksame #pampassword=asksame #pamsessionmng=127.0.0.1 #delay_ms=2000 [neutrinordp-any] name=neutrinordp-any lib=libxrdpneutrinordp.so ip=ask port=ask3389 username=ask password=ask ; 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.9.12/xrdp/xrdp.c000644 001751 001751 00000044247 13601643631 014614 0ustar00metameta000000 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 "xrdp.h" #include "log.h" #include "xrdp_configure_options.h" #if !defined(PACKAGE_VERSION) #define PACKAGE_VERSION "???" #endif #define THREAD_WAITING 100 static struct xrdp_listen *g_listen = 0; 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_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); /*****************************************************************************/ void print_version(void) { g_writeln("xrdp %s", PACKAGE_VERSION); g_writeln(" A Remote Desktop Protocol Server."); g_writeln(" Copyright (C) 2004-2018 Jay Sorg, " "Neutrino Labs, and all contributors."); 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()); } /*****************************************************************************/ void print_help(void) { g_writeln("Usage: xrdp [options]"); g_writeln(" -h, --help show help"); g_writeln(" -n, --nodaemon don't fork into background"); g_writeln(" -k, --kill shut down xrdp"); g_writeln(" -p, --port tcp listen port"); g_writeln(" -f, --fork fork on new connection"); } /*****************************************************************************/ /* 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); /*g_writeln("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); /*g_writeln("g_xrdp_sync processed BY main thread -> continue");*/ } return sync_result; } /*****************************************************************************/ void xrdp_shutdown(int sig) { tbus threadid; threadid = tc_get_threadid(); g_writeln("shutting down"); g_writeln("signal %d threadid %lld", sig, (long long)threadid); if (!g_is_wait_obj_set(g_term_event)) { g_set_wait_obj(g_term_event); } } /*****************************************************************************/ void xrdp_child(int sig) { int safety; for (safety = 0; (g_waitchild() >= 0) && (safety <= 10); safety++) { } } /*****************************************************************************/ void xrdp_hang_up(int sig) { log_message(LOG_LEVEL_INFO, "caught SIGHUP, noop..."); } /*****************************************************************************/ /* called in child just after fork */ int xrdp_child_fork(void) { int pid; char text[256]; /* close, don't delete these */ g_close_wait_obj(g_term_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_snprintf(text, 255, "xrdp_%8.8x_main_sync", pid); g_sync_event = g_create_wait_obj(text); return 0; } /*****************************************************************************/ 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_term_event(void) { return 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 SIGPIPE(%d)", sig_num); } /*****************************************************************************/ /*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); } /*****************************************************************************/ /** * * @brief Command line argument parser * @param number of command line arguments * @param pointer array of commandline arguments * @return 0 on success, n on nth argument is unknown * */ int xrdp_process_params(int argc, char **argv, struct xrdp_startup_params *startup_params) { int index; char option[128]; char value[128]; index = 1; while (index < argc) { g_strncpy(option, argv[index], 127); if (index + 1 < argc) { g_strncpy(value, argv[index + 1], 127); } else { value[0] = 0; } if ((g_strncasecmp(option, "-help", 255)) == 0 || (g_strncasecmp(option, "--help", 255)) == 0 || (g_strncasecmp(option, "-h", 255)) == 0) { startup_params->help = 1; } else if ((g_strncasecmp(option, "-kill", 255) == 0) || (g_strncasecmp(option, "--kill", 255) == 0) || (g_strncasecmp(option, "-k", 255) == 0)) { startup_params->kill = 1; } else if ((g_strncasecmp(option, "-nodaemon", 255) == 0) || (g_strncasecmp(option, "--nodaemon", 255) == 0) || (g_strncasecmp(option, "-n", 255) == 0) || (g_strncasecmp(option, "-nd", 255) == 0) || (g_strncasecmp(option, "--nd", 255) == 0) || (g_strncasecmp(option, "-ns", 255) == 0) || (g_strncasecmp(option, "--ns", 255) == 0)) { startup_params->no_daemon = 1; } else if ((g_strncasecmp(option, "-v", 255) == 0) || (g_strncasecmp(option, "--version", 255) == 0)) { startup_params->version = 1; } else if ((g_strncasecmp(option, "-p", 255) == 0) || (g_strncasecmp(option, "--port", 255) == 0)) { index++; g_strncpy(startup_params->port, value, 127); 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 ((g_strncasecmp(option, "-f", 255) == 0) || (g_strncasecmp(option, "--fork", 255) == 0)) { startup_params->fork = 1; g_writeln("--fork parameter found, ini override"); } else /* unknown option */ { return index; } index++; } return 0; } /*****************************************************************************/ /* Basic sanity checks before any forking */ int xrdp_sanity_check(void) { int intval = 1; int host_be; char key_file[256]; /* 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) { g_writeln("unusable int size, must be 4"); return 1; } if (sizeof(long) != sizeof(void *)) { g_writeln("long size must match void* size"); return 1; } if (sizeof(long) != 4 && sizeof(long) != 8) { g_writeln("unusable long size, must be 4 or 8"); return 1; } if (sizeof(tui64) != 8) { g_writeln("unusable tui64 size, must be 8"); return 1; } g_snprintf(key_file, 255, "%s/rsakeys.ini", XRDP_CFG_PATH); 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; int test; char cfg_file[256]; enum logReturns error; struct xrdp_startup_params *startup_params; int pid; int fd; int no_daemon; char text[256]; char pid_file[256]; int errored_argc; g_init("xrdp"); ssl_init(); for (test = 0; test < argc; test++) { DEBUG(("Argument %i - %s", test, argv[test])); } g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); startup_params = (struct xrdp_startup_params *) g_malloc(sizeof(struct xrdp_startup_params), 1); 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); } g_snprintf(pid_file, 255, "%s/xrdp.pid", XRDP_PID_PATH); no_daemon = 0; 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 (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(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(cfg_file, "xrdp"); 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; } g_deinit(); g_exit(1); } 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_deinit(); g_exit(0); } if (startup_params->no_daemon) { no_daemon = 1; } if (!no_daemon) { /* make sure containing directory exists */ g_create_path(pid_file); /* make sure we can write to pid file */ fd = g_file_open(pid_file); /* xrdp.pid */ if (fd == -1) { g_writeln("running in daemon mode with no access to pid files, quitting"); g_deinit(); 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_deinit(); g_exit(0); } g_file_close(fd); g_file_delete(pid_file); } if (!no_daemon) { /* if can't listen, exit with failure status */ if (xrdp_listen_test(startup_params) != 0) { log_message(LOG_LEVEL_ERROR, "Failed to start xrdp daemon, " "possibly address already in use."); 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) { g_writeln("problem forking"); g_deinit(); g_exit(1); } if (0 != pid) { g_writeln("daemon process %d started ok", pid); /* exit, this is the main process */ g_deinit(); g_exit(0); } g_sleep(1000); /* write the pid to file */ pid = g_getpid(); fd = g_file_open(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); } g_sleep(1000); g_file_close(0); g_file_close(1); g_file_close(2); if (g_file_open("/dev/null") < 0) { } if (g_file_open("/dev/null") < 0) { } if (g_file_open("/dev/null") < 0) { } /* end of daemonizing code */ } 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_signal_child_stop(xrdp_child); /* SIGCHLD */ g_signal_hang_up(xrdp_hang_up); /* SIGHUP */ g_sync_mutex = tc_mutex_create(); g_sync1_mutex = tc_mutex_create(); pid = g_getpid(); log_message(LOG_LEVEL_INFO, "starting xrdp with pid %d", pid); g_snprintf(text, 255, "xrdp_%8.8x_main_term", pid); g_term_event = g_create_wait_obj(text); if (g_term_event == 0) { g_writeln("error creating g_term_event"); } g_snprintf(text, 255, "xrdp_%8.8x_main_sync", pid); g_sync_event = g_create_wait_obj(text); if (g_sync_event == 0) { g_writeln("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_sync_mutex); tc_mutex_delete(g_sync1_mutex); g_delete_wait_obj(g_term_event); g_delete_wait_obj(g_sync_event); /* only main process should delete pid file */ if ((!no_daemon) && (pid == g_getpid())) { /* delete the xrdp.pid file */ g_file_delete(pid_file); } g_free(startup_params); log_end(); g_deinit(); if (exit_status == 0) { g_exit(0); } else { g_exit(1); } return 0; } xrdp-0.9.12/xrdp/xrdp_region.c000644 001751 001751 00000007222 13544635323 016154 0ustar00metameta000000 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; } xrdp-0.9.12/xrdp/czech.txt000644 001751 001751 00000003103 13544635323 015317 0ustar00metameta000000 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.9.12/xrdp/cursor1.cur000644 001751 001751 00000000506 13544635323 015577 0ustar00metameta000000 000000  0( @xrdp-0.9.12/xrdp/xrdp24b.bmp000644 001751 001751 00000440066 13544635323 015464 0ustar00metameta000000 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.9.12/xrdp/xrdp_mm.c000644 001751 001751 00000315530 13601643631 015301 0ustar00metameta000000 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" #ifndef USE_NOPAM #if defined(HAVE__PAM_TYPES_H) #define LINUXPAM 1 #include #elif defined(HAVE_PAM_CONSTANTS_H) #define OPENPAM 1 #include #endif #endif /* USE_NOPAM */ #include "xrdp_encoder.h" #include "xrdp_sockets.h" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do \ { \ if (_level < LLOG_LEVEL) \ { \ g_write("xrdp:xrdp_mm [%10.10u]: ", g_time3()); \ g_writeln _args ; \ } \ } \ while (0) /*****************************************************************************/ 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; LLOGLN(0, ("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)); 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_message(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->chan_trans_up = 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_mode(self->wm, 0); /* 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; self->sesman_trans_up = 0; list_delete(self->login_names); list_delete(self->login_values); g_free(self); } /*****************************************************************************/ /* Send login information to sesman */ static int xrdp_mm_send_login(struct xrdp_mm *self) { struct stream *s; int rv; int index; int count; int xserverbpp; char *username; char *password; char *name; char *value; xrdp_wm_log_msg(self->wm, LOG_LEVEL_DEBUG, "sending login info to session manager, please wait..."); username = 0; password = 0; self->code = 0; xserverbpp = 0; count = self->login_names->count; for (index = 0; index < count; index++) { name = (char *)list_get_item(self->login_names, index); value = (char *)list_get_item(self->login_values, index); if (g_strcasecmp(name, "username") == 0) { username = value; } else if (g_strcasecmp(name, "password") == 0) { password = value; } else if (g_strcasecmp(name, "code") == 0) { /* this code is either 0 for Xvnc, 10 for X11rdp or 20 for Xorg */ self->code = g_atoi(value); } else if (g_strcasecmp(name, "xserverbpp") == 0) { xserverbpp = g_atoi(value); } } if ((username == 0) || (password == 0)) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "Error finding username and password"); return 1; } s = trans_get_out_s(self->sesman_trans, 8192); s_push_layer(s, channel_hdr, 8); /* this code is either 0 for Xvnc, 10 for X11rdp or 20 for Xorg */ out_uint16_be(s, self->code); index = g_strlen(username); out_uint16_be(s, index); out_uint8a(s, username, index); index = g_strlen(password); out_uint16_be(s, index); out_uint8a(s, password, index); out_uint16_be(s, self->wm->screen->width); out_uint16_be(s, self->wm->screen->height); /* select and send X server bpp */ if (xserverbpp == 0) { if (self->code == 20) { xserverbpp = 24; /* xorgxrdp is always at 24 bpp */ } else { xserverbpp = self->wm->screen->bpp; /* use client's bpp */ } } out_uint16_be(s, xserverbpp); /* send domain */ if(self->wm->client_info->domain[0]!='_') { index = g_strlen(self->wm->client_info->domain); out_uint16_be(s, index); out_uint8a(s, self->wm->client_info->domain, index); } else { out_uint16_be(s, 0); /* out_uint8a(s, "", 0); */ } /* send program / shell */ index = g_strlen(self->wm->client_info->program); out_uint16_be(s, index); out_uint8a(s, self->wm->client_info->program, index); /* send directory */ index = g_strlen(self->wm->client_info->directory); out_uint16_be(s, index); out_uint8a(s, self->wm->client_info->directory, index); /* send client ip */ index = g_strlen(self->wm->client_info->client_ip); out_uint16_be(s, index); out_uint8a(s, self->wm->client_info->client_ip, index); s_mark_end(s); s_pop_layer(s, channel_hdr); /* Version 0 of the protocol to sesman is currently used by XRDP */ out_uint32_be(s, 0); /* version */ index = (int)(s->end - s->data); out_uint32_be(s, index); /* size */ rv = trans_force_write(self->sesman_trans); if (rv != 0) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_WARNING, "xrdp_mm_send_login: xrdp_mm_send_login failed"); } return rv; } /*****************************************************************************/ /* returns error */ /* this goes through the login_names looking for one called 'aname' then it copies the corresponding login_values item into 'dest' 'dest' must be at least 'dest_len' + 1 bytes in size */ static int xrdp_mm_get_value(struct xrdp_mm *self, const char *aname, char *dest, int dest_len) { char *name; char *value; int index; int count; int rv; rv = 1; /* find the library name */ dest[0] = 0; count = self->login_names->count; for (index = 0; index < count; index++) { name = (char *)list_get_item(self->login_names, index); value = (char *)list_get_item(self->login_values, index); if ((name == 0) || (value == 0)) { break; } if (g_strcasecmp(name, aname) == 0) { g_strncpy(dest, value, dest_len); rv = 0; } } return rv; } /*****************************************************************************/ static int xrdp_mm_setup_mod1(struct xrdp_mm *self) { void *func; char lib[256]; char text[256]; if (self == 0) { return 1; } lib[0] = 0; if (xrdp_mm_get_value(self, "lib", lib, 255) != 0) { 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, 255, "%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) { g_writeln("loaded module '%s' ok, interface size %d, version %d", lib, self->mod->size, self->mod->version); } } else { log_message(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_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 = server_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->server_reset = server_reset; 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->si = (tintptr) &(self->wm->session->si); } } /* id self->mod is null, there must be a problem */ if (self->mod == 0) { DEBUG(("problem loading lib in xrdp_mm_setup_mod1")); return 1; } return 0; } /*****************************************************************************/ static int xrdp_mm_setup_mod2(struct xrdp_mm *self, tui8 *guid) { char text[256]; const char *name; const char *value; int i; int rv; int key_flags; int device_flags; int use_uds; 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 == 0) /* Xvnc */ { g_snprintf(text, 255, "%d", 5900 + self->display); } else if (self->code == 10 || self->code == 20) /* X11rdp/Xorg */ { use_uds = 1; if (xrdp_mm_get_value(self, "ip", text, 255) == 0) { if (g_strcmp(text, "127.0.0.1") != 0) { use_uds = 0; } } if (use_uds) { g_snprintf(text, 255, XRDP_X11RDP_STR, self->display); } else { g_snprintf(text, 255, "%d", 6200 + 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_item(self->login_names, (long)g_strdup("port")); list_add_item(self->login_values, (long)g_strdup(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 != 0) { self->mod->mod_set_param(self->mod, "guid", (char *) 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, 17, 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 index; 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); index = 0; while (libxrdp_query_channel(self->wm->session, index, chan_name, &chan_flags) == 0) { chan_id = libxrdp_get_channel_id(self->wm->session, chan_name); out_uint8a(s, chan_name, 8); out_uint16_le(s, chan_id); out_uint16_le(s, chan_flags); index++; } s_mark_end(s); s_pop_layer(s, sec_hdr); out_uint16_le(s, index); 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) { int size; int total_size; int chan_id; int chan_flags; int rv; in_uint16_le(s, chan_id); in_uint16_le(s, chan_flags); in_uint16_le(s, size); in_uint32_le(s, total_size); rv = 0; if (rv == 0) { 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); g_writeln("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); g_writeln("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); g_writeln("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); g_writeln("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; g_writeln("xrdp_mm_process_rail_update_window_text:"); in_uint32_le(s, window_id); in_uint32_le(s, flags); g_writeln(" update window title info: 0x%8.8x", window_id); g_memset(&rwso, 0, sizeof(rwso)); in_uint32_le(s, size); /* title size */ rwso.title_info = g_new(char, size + 1); in_uint8a(s, rwso.title_info, size); rwso.title_info[size] = 0; g_writeln(" 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); } g_writeln(" 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; } /******************************************************************************/ int xrdp_mm_drdynvc_up(struct xrdp_mm* self) { LLOGLN(0, ("xrdp_mm_drdynvc_up:")); return 0; } /******************************************************************************/ int xrdp_mm_suppress_output(struct xrdp_mm* self, int suppress, int left, int top, int right, int bottom) { LLOGLN(0, ("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; } /*****************************************************************************/ /* 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; LLOGLN(10, ("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; 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 > 1024)) { return 1; } name = g_new(char, name_bytes + 1); if (name == NULL) { return 1; } if (!s_check_rem(s, name_bytes)) { g_free(name); return 1; } in_uint8a(s, name, name_bytes); name[name_bytes] = 0; if (!s_check_rem(s, 8)) { g_free(name); return 1; } in_uint32_le(s, flags); in_uint32_le(s, chansrv_chan_id); if (flags == 0) { /* open static channel, not supported */ g_free(name); 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) { g_free(name); return 1; } self->xr2cr_cid_map[chan_id] = chansrv_chan_id; self->cs2xr_cid_map[chansrv_chan_id] = chan_id; } g_free(name); 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); 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; LLOGLN(10, ("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_message(LOG_LEVEL_ERROR,"xrdp_mm_chan_process_msg: unknown id %d", id); break; } s->end = s_end; if (rv != 0) { LLOGLN(0, ("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 == 0) { 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); LLOGLN(10, ("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); LLOGLN(10, ("xrdp_mm_chan_data_in: got whole message, reset for " "next header")); return error; } /*****************************************************************************/ /* connect to chansrv */ static int xrdp_mm_connect_chansrv(struct xrdp_mm *self, const char *ip, const char *port) { int index; self->usechansrv = 1; if (self->wm->client_info->channels_allowed == 0) { log_message(LOG_LEVEL_DEBUG, "%s: " "skip connecting to chansrv because all channels are disabled", __func__); return 0; } /* connect channel redir */ if ((g_strcmp(ip, "127.0.0.1") == 0) || (ip[0] == 0)) { /* unix socket */ self->chan_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192); } else { /* tcp */ self->chan_trans = trans_create(TRANS_MODE_TCP, 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 up to 4 times */ for (index = 0; index < 4; index++) { if (trans_connect(self->chan_trans, ip, port, 3000) == 0) { self->chan_trans_up = 1; break; } if (g_is_term()) { break; } g_sleep(1000); log_message(LOG_LEVEL_ERROR,"xrdp_mm_connect_chansrv: connect failed " "trying again..."); } if (!(self->chan_trans_up)) { log_message(LOG_LEVEL_ERROR,"xrdp_mm_connect_chansrv: error in " "trans_connect chan"); } if (self->chan_trans_up) { if (xrdp_mm_trans_send_channel_setup(self, self->chan_trans) != 0) { log_message(LOG_LEVEL_ERROR,"xrdp_mm_connect_chansrv: error in " "xrdp_mm_trans_send_channel_setup"); } else { log_message(LOG_LEVEL_DEBUG,"xrdp_mm_connect_chansrv: chansrv " "connect successful"); } } return 0; } static void cleanup_sesman_connection(struct xrdp_mm *self) { self->delete_sesman_trans = 1; self->connected_state = 0; if (self->wm->login_mode != 10) { xrdp_wm_set_login_mode(self->wm, 11); xrdp_mm_module_cleanup(self); } } /*****************************************************************************/ /* 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) { g_writeln("xrdp_mm_update_allowed_channels: channel %s " "channel id %d is disabled", chan_name, chan_id); } else { g_writeln("xrdp_mm_update_allowed_channels: channel %s " "channel id %d is allowed", chan_name, chan_id); } } } return 0; } /*****************************************************************************/ static int xrdp_mm_process_login_response(struct xrdp_mm *self, struct stream *s) { int ok; int display; int rv; char ip[256]; char port[256]; tui8 guid[16]; tui8* pguid; rv = 0; in_uint16_be(s, ok); in_uint16_be(s, display); pguid = 0; if (s_check_rem(s, 16)) { in_uint8a(s, guid, 16); pguid = guid; } if (ok) { self->display = display; xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "login successful for display %d", display); if (xrdp_mm_setup_mod1(self) == 0) { if (xrdp_mm_setup_mod2(self, pguid) == 0) { xrdp_mm_get_value(self, "ip", ip, 255); xrdp_wm_set_login_mode(self->wm, 10); self->wm->dragging = 0; /* connect channel redir */ if ((g_strcmp(ip, "127.0.0.1") == 0) || (ip[0] == 0)) { g_snprintf(port, 255, XRDP_CHANSRV_STR, display); } else { g_snprintf(port, 255, "%d", 7200 + display); } xrdp_mm_update_allowed_channels(self); xrdp_mm_connect_chansrv(self, ip, port); } } } else { xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "login failed for display %d", display); xrdp_wm_show_log(self->wm); if (self->wm->hide_log_window) { rv = 1; } } cleanup_sesman_connection(self); return rv; } /*****************************************************************************/ 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(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_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_message(LOG_LEVEL_DEBUG,"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; } /*****************************************************************************/ /* This is the callback registered for sesman communication replies. */ static int xrdp_mm_sesman_data_in(struct trans *trans) { struct xrdp_mm *self; struct stream *s; int version; int size; int error; int code; if (trans == 0) { return 1; } self = (struct xrdp_mm *)(trans->callback_data); s = trans_get_in_s(trans); if (s == 0) { return 1; } in_uint32_be(s, version); in_uint32_be(s, size); error = trans_force_read(trans, size - 8); if (error == 0) { in_uint16_be(s, code); switch (code) { /* even when the request is denied the reply will hold 3 as the command. */ case 3: error = xrdp_mm_process_login_response(self, s); break; default: xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "Undefined reply code %d received from sesman", code); cleanup_sesman_connection(self); break; } } return error; } #ifndef USE_NOPAM /*********************************************************************/ /* return 0 on success */ static int access_control(char *username, char *password, char *srv) { int reply; int rec = 32+1; /* 32 is reserved for PAM failures this means connect failure */ struct stream *in_s; struct stream *out_s; unsigned long version; unsigned short int dummy; unsigned short int pAM_errorcode; unsigned short int code; unsigned long size; int index; int socket = g_tcp_socket(); char port[8]; if (socket != -1) { xrdp_mm_get_sesman_port(port, sizeof(port)); /* we use a blocking socket here */ reply = g_tcp_connect(socket, srv, port); if (reply == 0) { make_stream(in_s); init_stream(in_s, 500); make_stream(out_s); init_stream(out_s, 500); s_push_layer(out_s, channel_hdr, 8); out_uint16_be(out_s, 4); /*0x04 means SCP_GW_AUTHENTICATION*/ index = g_strlen(username); out_uint16_be(out_s, index); out_uint8a(out_s, username, index); index = g_strlen(password); out_uint16_be(out_s, index); out_uint8a(out_s, password, index); s_mark_end(out_s); s_pop_layer(out_s, channel_hdr); out_uint32_be(out_s, 0); /* version */ index = (int)(out_s->end - out_s->data); out_uint32_be(out_s, index); /* size */ /* g_writeln("Number of data to send : %d",index); */ reply = g_tcp_send(socket, out_s->data, index, 0); free_stream(out_s); if (reply > 0) { /* We wait in 5 sec for a reply from sesman*/ if (g_sck_can_recv(socket, 5000)) { reply = g_tcp_recv(socket, in_s->end, 500, 0); if (reply > 0) { in_s->end = in_s->end + reply; in_uint32_be(in_s, version); /*g_writeln("Version number in reply from sesman: %d",version) ; */ in_uint32_be(in_s, size); if ((size == 14) && (version == 0)) { in_uint16_be(in_s, code); in_uint16_be(in_s, pAM_errorcode); /* this variable holds the PAM error code if the variable is >32 it is a "invented" code */ in_uint16_be(in_s, dummy); if (code != 4) /*0x04 means SCP_GW_AUTHENTICATION*/ { log_message(LOG_LEVEL_ERROR, "Returned cmd code from " "sesman is corrupt"); } else { rec = pAM_errorcode; /* here we read the reply from the access control */ } } else { log_message(LOG_LEVEL_ERROR, "Corrupt reply size or " "version from sesman: %ld", size); } } else { log_message(LOG_LEVEL_ERROR, "No data received from sesman"); } } else { log_message(LOG_LEVEL_ERROR, "Timeout when waiting for sesman"); } } else { log_message(LOG_LEVEL_ERROR, "No success sending to sesman"); } free_stream(in_s); g_tcp_close(socket); } else { log_message(LOG_LEVEL_ERROR, "Failure connecting to socket sesman"); } } else { log_message(LOG_LEVEL_ERROR, "Failure creating socket - for access control"); } if (socket != -1) g_tcp_close(socket); return rec; } #endif /*****************************************************************************/ /* 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.*/ static void cleanup_states(struct xrdp_mm *self) { if (self != NULL) { self-> connected_state = 0; /* true if connected to sesman else false */ self-> sesman_trans = NULL; /* connection to sesman */ self-> sesman_trans_up = 0; /* true once connected to sesman */ self-> delete_sesman_trans = 0; /* boolean set when done with sesman connection */ self-> display = 0; /* 10 for :10.0, 11 for :11.0, etc */ self-> code = 0; /* 0 Xvnc session, 10 X11rdp session, 20 Xorg session */ self-> sesman_controlled = 0; /* true if this is a sesman session */ self-> chan_trans = NULL; /* connection to chansrv */ self-> chan_trans_up = 0; /* true once connected to chansrv */ self-> delete_chan_trans = 0; /* boolean set when done with channel connection */ self-> usechansrv = 0; /* true if chansrvport is set in xrdp.ini or using sesman */ } } #ifndef USE_NOPAM static const char * getPAMError(const int pamError, char *text, int text_bytes) { switch (pamError) { #if defined(LINUXPAM) case PAM_SUCCESS: return "Success"; case PAM_OPEN_ERR: return "dlopen() failure"; case PAM_SYMBOL_ERR: return "Symbol not found"; case PAM_SERVICE_ERR: return "Error in service module"; case PAM_SYSTEM_ERR: return "System error"; case PAM_BUF_ERR: return "Memory buffer error"; case PAM_PERM_DENIED: return "Permission denied"; case PAM_AUTH_ERR: return "Authentication failure"; case PAM_CRED_INSUFFICIENT: return "Insufficient credentials to access authentication data"; case PAM_AUTHINFO_UNAVAIL: return "Authentication service cannot retrieve authentication info."; case PAM_USER_UNKNOWN: return "User not known to the underlying authentication module"; case PAM_MAXTRIES: return "Have exhausted maximum number of retries for service."; case PAM_NEW_AUTHTOK_REQD: return "Authentication token is no longer valid; new one required."; case PAM_ACCT_EXPIRED: return "User account has expired"; case PAM_CRED_UNAVAIL: return "Authentication service cannot retrieve user credentials"; case PAM_CRED_EXPIRED: return "User credentials expired"; case PAM_CRED_ERR: return "Failure setting user credentials"; case PAM_NO_MODULE_DATA: return "No module specific data is present"; case PAM_BAD_ITEM: return "Bad item passed to pam_*_item()"; case PAM_CONV_ERR: return "Conversation error"; case PAM_AUTHTOK_ERR: return "Authentication token manipulation error"; case PAM_AUTHTOK_LOCK_BUSY: return "Authentication token lock busy"; case PAM_AUTHTOK_DISABLE_AGING: return "Authentication token aging disabled"; case PAM_TRY_AGAIN: return "Failed preliminary check by password service"; case PAM_IGNORE: return "Please ignore underlying account module"; case PAM_MODULE_UNKNOWN: return "Module is unknown"; case PAM_AUTHTOK_EXPIRED: return "Authentication token expired"; case PAM_CONV_AGAIN: return "Conversation is waiting for event"; case PAM_INCOMPLETE: return "Application needs to call libpam again"; case 32 + 1: return "Error connecting to PAM"; case 32 + 3: return "Username okey but group problem"; default: g_snprintf(text, text_bytes, "Not defined PAM error:%d", pamError); return text; #elif defined(OPENPAM) case PAM_SUCCESS: /* 0 */ return "Success"; case PAM_OPEN_ERR: return "dlopen() failure"; case PAM_SYMBOL_ERR: return "Symbol not found"; case PAM_SERVICE_ERR: return "Error in service module"; case PAM_SYSTEM_ERR: return "System error"; case PAM_BUF_ERR: return "Memory buffer error"; case PAM_CONV_ERR: return "Conversation error"; case PAM_PERM_DENIED: return "Permission denied"; case PAM_MAXTRIES: return "Have exhausted maximum number of retries for service."; case PAM_AUTH_ERR: return "Authentication failure"; case PAM_NEW_AUTHTOK_REQD: /* 10 */ return "Authentication token is no longer valid; new one required."; case PAM_CRED_INSUFFICIENT: return "Insufficient credentials to access authentication data"; case PAM_AUTHINFO_UNAVAIL: return "Authentication service cannot retrieve authentication info."; case PAM_USER_UNKNOWN: return "User not known to the underlying authentication module"; case PAM_CRED_UNAVAIL: return "Authentication service cannot retrieve user credentials"; case PAM_CRED_EXPIRED: return "User credentials expired"; case PAM_CRED_ERR: return "Failure setting user credentials"; case PAM_ACCT_EXPIRED: return "User account has expired"; case PAM_AUTHTOK_EXPIRED: return "Authentication token expired"; case PAM_SESSION_ERR: return "Session failure"; case PAM_AUTHTOK_ERR: /* 20 */ return "Authentication token manipulation error"; case PAM_AUTHTOK_RECOVERY_ERR: return "Failed to recover old authentication token"; case PAM_AUTHTOK_LOCK_BUSY: return "Authentication token lock busy"; case PAM_AUTHTOK_DISABLE_AGING: return "Authentication token aging disabled"; case PAM_NO_MODULE_DATA: return "No module specific data is present"; case PAM_IGNORE: return "Please ignore underlying account module"; case PAM_ABORT: return "General failure"; case PAM_TRY_AGAIN: return "Failed preliminary check by password service"; case PAM_MODULE_UNKNOWN: return "Module is unknown"; case PAM_DOMAIN_UNKNOWN: /* 29 */ return "Unknown authentication domain"; default: g_snprintf(text, text_bytes, "Not defined PAM error:%d", pamError); return text; #endif } } static const char * getPAMAdditionalErrorInfo(const int pamError, struct xrdp_mm *self) { switch (pamError) { #if defined(LINUXPAM) case PAM_SUCCESS: return NULL; case PAM_OPEN_ERR: case PAM_SYMBOL_ERR: case PAM_SERVICE_ERR: case PAM_SYSTEM_ERR: case PAM_BUF_ERR: case PAM_PERM_DENIED: case PAM_AUTH_ERR: case PAM_CRED_INSUFFICIENT: case PAM_AUTHINFO_UNAVAIL: case PAM_USER_UNKNOWN: case PAM_CRED_UNAVAIL: case PAM_CRED_ERR: case PAM_NO_MODULE_DATA: case PAM_BAD_ITEM: case PAM_CONV_ERR: case PAM_AUTHTOK_ERR: case PAM_AUTHTOK_LOCK_BUSY: case PAM_AUTHTOK_DISABLE_AGING: case PAM_TRY_AGAIN: case PAM_IGNORE: case PAM_MODULE_UNKNOWN: case PAM_CONV_AGAIN: case PAM_INCOMPLETE: case _PAM_RETURN_VALUES + 1: case _PAM_RETURN_VALUES + 3: return NULL; case PAM_MAXTRIES: case PAM_NEW_AUTHTOK_REQD: case PAM_ACCT_EXPIRED: case PAM_CRED_EXPIRED: case PAM_AUTHTOK_EXPIRED: if (self->wm->pamerrortxt[0]) { return self->wm->pamerrortxt; } else { return "Authentication error - Verify that user/password is valid"; } default: return "No expected error"; #elif defined(OPENPAM) case PAM_SUCCESS: /* 0 */ return NULL; case PAM_OPEN_ERR: case PAM_SYMBOL_ERR: case PAM_SERVICE_ERR: case PAM_SYSTEM_ERR: case PAM_BUF_ERR: case PAM_CONV_ERR: case PAM_PERM_DENIED: case PAM_MAXTRIES: case PAM_AUTH_ERR: case PAM_NEW_AUTHTOK_REQD: /* 10 */ case PAM_CRED_INSUFFICIENT: case PAM_AUTHINFO_UNAVAIL: case PAM_USER_UNKNOWN: case PAM_CRED_UNAVAIL: case PAM_CRED_EXPIRED: case PAM_CRED_ERR: case PAM_ACCT_EXPIRED: case PAM_AUTHTOK_EXPIRED: case PAM_SESSION_ERR: case PAM_AUTHTOK_ERR: /* 20 */ case PAM_AUTHTOK_RECOVERY_ERR: case PAM_AUTHTOK_LOCK_BUSY: case PAM_AUTHTOK_DISABLE_AGING: case PAM_NO_MODULE_DATA: case PAM_IGNORE: case PAM_ABORT: case PAM_TRY_AGAIN: case PAM_MODULE_UNKNOWN: case PAM_DOMAIN_UNKNOWN: /* 29 */ if (self->wm->pamerrortxt[0]) { return self->wm->pamerrortxt; } else { return "Authentication error - Verify that user/password is valid"; } default: return "No expected error"; #endif } } #endif /*****************************************************************************/ int xrdp_mm_connect(struct xrdp_mm *self) { struct list *names; struct list *values; int index; int count; int ok; int rv; char *name; char *value; char ip[256]; char port[8]; char chansrvport[256]; #ifndef USE_NOPAM int use_pam_auth = 0; char pam_auth_sessionIP[256]; char pam_auth_password[256]; char pam_auth_username[256]; #endif char username[256]; char password[256]; username[0] = 0; password[0] = 0; /* make sure we start in correct state */ cleanup_states(self); g_memset(ip, 0, sizeof(ip)); g_memset(port, 0, sizeof(port)); g_memset(chansrvport, 0, sizeof(chansrvport)); rv = 0; /* success */ names = self->login_names; values = self->login_values; count = names->count; for (index = 0; index < count; index++) { name = (char *)list_get_item(names, index); value = (char *)list_get_item(values, index); if (g_strcasecmp(name, "ip") == 0) { g_strncpy(ip, value, 255); } else if (g_strcasecmp(name, "port") == 0) { if (g_strcasecmp(value, "-1") == 0) { self->sesman_controlled = 1; } } #ifndef USE_NOPAM else if (g_strcasecmp(name, "pamusername") == 0) { use_pam_auth = 1; g_strncpy(pam_auth_username, value, 255); } else if (g_strcasecmp(name, "pamsessionmng") == 0) { g_strncpy(pam_auth_sessionIP, value, 255); } else if (g_strcasecmp(name, "pampassword") == 0) { g_strncpy(pam_auth_password, value, 255); } #endif else if (g_strcasecmp(name, "password") == 0) { g_strncpy(password, value, 255); } else if (g_strcasecmp(name, "username") == 0) { g_strncpy(username, value, 255); } else if (g_strcasecmp(name, "chansrvport") == 0) { g_strncpy(chansrvport, value, 255); self->usechansrv = 1; } } #ifndef USE_NOPAM if (use_pam_auth) { int reply; char pam_error[128]; const char *additionalError; xrdp_wm_log_msg(self->wm, LOG_LEVEL_DEBUG, "Please wait, we now perform access control..."); /* g_writeln("we use pam modules to check if we can approve this user"); */ if (!g_strncmp(pam_auth_username, "same", 255)) { log_message(LOG_LEVEL_DEBUG, "pamusername copied from username - same: %s", username); g_strncpy(pam_auth_username, username, 255); } if (!g_strncmp(pam_auth_password, "same", 255)) { log_message(LOG_LEVEL_DEBUG, "pam_auth_password copied from username - same: %s", password); g_strncpy(pam_auth_password, password, 255); } /* access_control return 0 on success */ reply = access_control(pam_auth_username, pam_auth_password, pam_auth_sessionIP); xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "Reply from access control: %s", getPAMError(reply, pam_error, 127)); additionalError = getPAMAdditionalErrorInfo(reply, self); if (additionalError && additionalError[0]) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "%s", additionalError); } if (reply != 0) { rv = 1; return rv; } } #endif if (self->sesman_controlled) { ok = 0; trans_delete(self->sesman_trans); self->sesman_trans = trans_create(TRANS_MODE_TCP, 8192, 8192); self->sesman_trans->is_term = g_is_term; xrdp_mm_get_sesman_port(port, sizeof(port)); xrdp_wm_log_msg(self->wm, LOG_LEVEL_DEBUG, "connecting to sesman ip %s port %s", ip, port); /* xrdp_mm_sesman_data_in is the callback that is called when data arrives */ self->sesman_trans->trans_data_in = xrdp_mm_sesman_data_in; self->sesman_trans->header_size = 8; self->sesman_trans->callback_data = self; /* try to connect up to 4 times */ for (index = 0; index < 4; index++) { if (trans_connect(self->sesman_trans, ip, port, 3000) == 0) { self->sesman_trans_up = 1; ok = 1; break; } if (g_is_term()) { break; } g_sleep(1000); g_writeln("xrdp_mm_connect: connect failed " "trying again..."); } if (ok) { /* fully connect */ xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "sesman connect ok"); self->connected_state = 1; rv = xrdp_mm_send_login(self); } else { xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "Error connecting to sesman: %s port: %s", ip, port); trans_delete(self->sesman_trans); self->sesman_trans = 0; self->sesman_trans_up = 0; rv = 1; } } else /* no sesman */ { if (xrdp_mm_setup_mod1(self) == 0) { if (xrdp_mm_setup_mod2(self, 0) == 0) { xrdp_wm_set_login_mode(self->wm, 10); rv = 0; /*success*/ } else { /* connect error */ xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "Error connecting to: %s", ip); rv = 1; /* failure */ } } else { log_message(LOG_LEVEL_ERROR,"Failure setting up module"); } if (self->wm->login_mode != 10) { xrdp_wm_set_login_mode(self->wm, 11); xrdp_mm_module_cleanup(self); rv = 1; /* failure */ } } if ((self->wm->login_mode == 10) && (self->sesman_controlled == 0) && (self->usechansrv != 0)) { /* if sesman controlled, this will connect later */ xrdp_mm_connect_chansrv(self, "", chansrvport); } log_message(LOG_LEVEL_DEBUG,"return value from xrdp_mm_connect %d", rv); return rv; } /*****************************************************************************/ 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_up) { trans_get_wait_objs(self->sesman_trans, read_objs, rcount); } if ((self->chan_trans != 0) && self->chan_trans_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; } 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("/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++; g_writeln("dumping jpeg index %d", jj); } return 0; } #endif /*****************************************************************************/ int xrdp_mm_check_chan(struct xrdp_mm *self) { //g_writeln("xrdp_mm_check_chan:"); if ((self->chan_trans != 0) && self->chan_trans_up) { if (trans_check_wait_objs(self->chan_trans) != 0) { self->delete_chan_trans = 1; } } if (self->delete_chan_trans) { trans_delete(self->chan_trans); self->chan_trans = 0; self->chan_trans_up = 0; self->delete_chan_trans = 0; } 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) { LLOGLN(10, ("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_process_enc_done(struct xrdp_mm *self) { XRDP_ENC_DATA_DONE *enc_done; int x; int y; int cx; int cy; 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; } /* do something with msg */ LLOGLN(10, ("xrdp_mm_process_enc_done: message back bytes %d", enc_done->comp_bytes)); x = enc_done->x; y = enc_done->y; cx = enc_done->cx; cy = enc_done->cy; if (enc_done->comp_bytes > 0) { libxrdp_fastpath_send_frame_marker(self->wm->session, 0, enc_done->enc->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); libxrdp_fastpath_send_frame_marker(self->wm->session, 1, enc_done->enc->frame_id); } /* free enc_done */ if (enc_done->last) { LLOGLN(10, ("xrdp_mm_process_enc_done: last set")); if (self->wm->client_info->use_frame_acks == 0) { self->mod->mod_frame_ack(self->mod, enc_done->enc->flags, enc_done->enc->frame_id); } else { self->encoder->frame_id_server = enc_done->enc->frame_id; xrdp_mm_update_module_frame_ack(self); } g_free(enc_done->enc->drects); g_free(enc_done->enc->crects); g_free(enc_done->enc); } g_free(enc_done->comp_pad_data); g_free(enc_done); } return 0; } /*****************************************************************************/ 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->sesman_trans_up) { if (trans_check_wait_objs(self->sesman_trans) != 0) { self->delete_sesman_trans = 1; if (self->wm->hide_log_window) { /* if hide_log_window, this is fatal */ rv = 1; } } } if ((self->chan_trans != NULL) && self->chan_trans_up) { if (trans_check_wait_objs(self->chan_trans) != 0) { self->delete_chan_trans = 1; } } if (self->mod != NULL) { if (self->mod->mod_check_wait_objs != NULL) { rv = self->mod->mod_check_wait_objs(self->mod); } } if (self->delete_sesman_trans) { trans_delete(self->sesman_trans); self->sesman_trans = NULL; self->sesman_trans_up = 0; self->delete_sesman_trans = 0; } if (self->delete_chan_trans) { trans_delete(self->chan_trans); self->chan_trans = NULL; self->chan_trans_up = 0; self->delete_chan_trans = 0; } 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); } } return rv; } /*****************************************************************************/ /* frame ack from client */ int xrdp_mm_frame_ack(struct xrdp_mm *self, int frame_id) { struct xrdp_encoder *encoder; LLOGLN(10, ("xrdp_mm_frame_ack:")); if (self->wm->client_info->use_frame_acks == 0) { return 1; } encoder = self->encoder; LLOGLN(10, ("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; } /*****************************************************************************/ 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 { g_writeln("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) { 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; LLOGLN(10, ("server_paint_rects:")); LLOGLN(10, ("server_paint_rects: %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) { return 1; } enc_data->drects = (short *) g_malloc(sizeof(short) * num_drects * 4, 0); if (enc_data->drects == 0) { g_free(enc_data); return 1; } enc_data->crects = (short *) g_malloc(sizeof(short) * num_crects * 4, 0); if (enc_data->crects == 0) { g_free(enc_data->drects); g_free(enc_data); return 1; } g_memcpy(enc_data->drects, drects, sizeof(short) * num_drects * 4); g_memcpy(enc_data->crects, crects, sizeof(short) * num_crects * 4); enc_data->mod = mod; enc_data->num_drects = num_drects; enc_data->num_crects = num_crects; enc_data->data = data; enc_data->width = width; enc_data->height = height; enc_data->flags = flags; enc_data->frame_id = frame_id; if (width == 0 || height == 0) { LLOGLN(10, ("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; } //g_writeln("server_paint_rects:"); 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); return 0; } /*****************************************************************************/ int server_session_info(struct xrdp_mod *mod, const char *data, int data_bytes) { struct xrdp_wm *wm; LLOGLN(10, ("server_session_info:")); wm = (struct xrdp_wm *)(mod->wm); return libxrdp_send_session_info(wm->session, data, data_bytes); } /*****************************************************************************/ 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); 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); 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, char *msg, int code) { struct xrdp_wm *wm; if (code == 1) { g_writeln("%s",msg); return 0; } wm = (struct xrdp_wm *)(mod->wm); return xrdp_wm_log_msg(wm, LOG_LEVEL_DEBUG, "%s", msg); } /*****************************************************************************/ int server_is_term(struct xrdp_mod *mod) { return g_is_term(); } /*****************************************************************************/ 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 server_reset(struct xrdp_mod *mod, int width, int height, int bpp) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); if (wm->client_info == 0) { return 1; } /* older client can't resize */ if (wm->client_info->build <= 419) { return 0; } /* if same, don't need to do anything */ if (wm->client_info->width == width && wm->client_info->height == height && wm->client_info->bpp == bpp) { return 0; } /* reset lib, client_info gets updated in libxrdp_reset */ if (libxrdp_reset(wm->session, width, height, bpp) != 0) { return 1; } /* reset cache */ xrdp_cache_reset(wm->cache, wm->client_info); /* resize the main window */ xrdp_bitmap_resize(wm->screen, wm->client_info->width, wm->client_info->height); /* load some stuff */ xrdp_wm_load_static_colors_plus(wm, 0); xrdp_wm_load_static_pointers(wm); return 0; } /*****************************************************************************/ /*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->usechansrv) { 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->usechansrv) { 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->usechansrv) { /* * Xvnc backend reaches here * should not return 1 as this case is not an error */ return 0; } /* vnc proxy mode reaches here */ 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_message(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) { g_writeln("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; //g_writeln("server_switch_os_surface: id 0x%x", id); wm = (struct xrdp_wm *)(mod->wm); if (rdpindex == -1) { //g_writeln("server_switch_os_surface: setting target_surface to screen"); wm->target_surface = wm->screen; p = (struct xrdp_painter *)(mod->painter); if (p != 0) { //g_writeln("setting target"); wm_painter_set_target(p); } return 0; } bi = xrdp_cache_get_os_bitmap(wm->cache, rdpindex); if ((bi != 0) && (bi->bitmap != 0)) { //g_writeln("server_switch_os_surface: setting target_surface to rdpid %d", id); wm->target_surface = bi->bitmap; p = (struct xrdp_painter *)(mod->painter); if (p != 0) { //g_writeln("setting target"); wm_painter_set_target(p); } } else { log_message(LOG_LEVEL_ERROR,"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; //g_writeln("server_delete_os_surface: id 0x%x", id); wm = (struct xrdp_wm *)(mod->wm); if (wm->target_surface->type == WND_TYPE_OFFSCREEN) { if (wm->target_surface->id == rdpindex) { g_writeln("server_delete_os_surface: setting target_surface to screen"); wm->target_surface = wm->screen; p = (struct xrdp_painter *)(mod->painter); if (p != 0) { //g_writeln("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_message(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.9.12/xrdp/xrdp_keyboard.ini000644 001751 001751 00000006762 13544635323 017036 0ustar00metameta000000 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_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_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=dvorak 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 ; 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=dvorak 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.9.12/xrdp/xrdp_bitmap.c000644 001751 001751 00000174665 13544635323 016165 0ustar00metameta000000 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" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do \ { \ if (_level < LLOG_LEVEL) \ { \ g_write("xrdp:xrdp_bitmap [%10.10u]: ", g_time3()); \ g_writeln _args ; \ } \ } \ while (0) 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_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); 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 = (char *)g_malloc(width * height * Bpp, 0); } #if defined(XRDP_PAINTER) if (self->type == WND_TYPE_SCREEN) /* noorders */ { LLOGLN(0, ("xrdp_bitmap_create: noorders")); self->data = (char *) g_malloc(width * height * Bpp, 0); } #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); } /*****************************************************************************/ 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; 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); if (focused) { /* active title bar */ painter->fg_color = self->wm->blue; xrdp_painter_fill_rect(painter, self, 3, 3, self->width - 5, 18); 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, 18); 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; } /*****************************************************************************/ static int xrdp_bitmap_get_index(struct xrdp_bitmap *self, 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); } /*****************************************************************************/ /* 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; } self->width = width; self->height = height; Bpp = 4; switch (self->bpp) { case 8: Bpp = 1; break; case 15: Bpp = 2; break; case 16: Bpp = 2; break; } g_free(self->data); self->data = (char *)g_malloc(width * height * Bpp, 0); self->line_size = width * Bpp; return 0; } /*****************************************************************************/ /* load a bmp file */ /* return 0 ok */ /* return 1 error */ int xrdp_bitmap_load(struct xrdp_bitmap *self, const char *filename, int *palette) { int fd = 0; int i = 0; int j = 0; int k = 0; int color = 0; int size = 0; int palette1[256]; char type1[4]; struct xrdp_bmp_header header; struct stream *s = (struct stream *)NULL; g_memset(palette1, 0, sizeof(int) * 256); g_memset(type1, 0, sizeof(char) * 4); g_memset(&header, 0, sizeof(struct xrdp_bmp_header)); if (!g_file_exist(filename)) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap file [%s] " "does not exist", filename); return 1; } fd = g_file_open(filename); if (fd != -1) { /* read file type */ if (g_file_read(fd, type1, 2) != 2) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap file [%s] " "read error", filename); g_file_close(fd); return 1; } if ((type1[0] != 'B') || (type1[1] != 'M')) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap file [%s] " "not BMP file", filename); g_file_close(fd); return 1; } /* read file size */ make_stream(s); init_stream(s, 8192); g_file_read(fd, s->data, 4); in_uint32_le(s, size); /* read bmp header */ if (g_file_seek(fd, 14) < 0) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s", filename); free_stream(s); g_file_close(fd); return 1; } init_stream(s, 8192); g_file_read(fd, s->data, 40); /* size better be 40 */ 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.bit_count != 4) && (header.bit_count != 8) && (header.bit_count != 24)) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap file [%s] " "bad bpp %d", filename, header.bit_count); free_stream(s); g_file_close(fd); return 1; } if (header.bit_count == 24) /* 24 bit bitmap */ { if (g_file_seek(fd, 14 + header.size) < 0) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s", filename); } xrdp_bitmap_resize(self, header.image_width, header.image_height); size = header.image_width * header.image_height * 3; init_stream(s, size); /* read data */ for (i = header.image_height - 1; i >= 0; i--) { size = header.image_width * 3; k = g_file_read(fd, s->data + i * size, size); if (k != size) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap " "file [%s] read", filename); } } for (i = 0; i < self->height; i++) { 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, 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, i, color); } } } else if (header.bit_count == 8) /* 8 bit bitmap */ { /* read palette */ if (g_file_seek(fd, 14 + header.size) < 0) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s", filename); } init_stream(s, 8192); g_file_read(fd, s->data, header.clr_used * sizeof(int)); for (i = 0; i < header.clr_used; i++) { in_uint32_le(s, palette1[i]); } xrdp_bitmap_resize(self, header.image_width, header.image_height); size = header.image_width * header.image_height; init_stream(s, size); /* read data */ for (i = header.image_height - 1; i >= 0; i--) { size = header.image_width; k = g_file_read(fd, s->data + i * size, size); if (k != size) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap " "file [%s] read", filename); } } for (i = 0; i < self->height; i++) { for (j = 0; j < self->width; j++) { in_uint8(s, k); color = palette1[k]; if (self->bpp == 8) { color = xrdp_bitmap_get_index(self, 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, i, color); } } } else if (header.bit_count == 4) /* 4 bit bitmap */ { /* read palette */ if (g_file_seek(fd, 14 + header.size) < 0) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s", filename); } init_stream(s, 8192); g_file_read(fd, s->data, header.clr_used * sizeof(int)); for (i = 0; i < header.clr_used; i++) { in_uint32_le(s, palette1[i]); } xrdp_bitmap_resize(self, header.image_width, header.image_height); size = (header.image_width * header.image_height) / 2; init_stream(s, size); /* read data */ for (i = header.image_height - 1; i >= 0; i--) { size = header.image_width / 2; k = g_file_read(fd, s->data + i * size, size); if (k != size) { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap " "file [%s] read", filename); } } for (i = 0; i < self->height; i++) { for (j = 0; j < self->width; j++) { if ((j & 1) == 0) { in_uint8(s, k); color = (k >> 4) & 0xf; } else { color = k & 0xf; } color = palette1[color]; if (self->bpp == 8) { color = xrdp_bitmap_get_index(self, 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, i, color); } } } g_file_close(fd); free_stream(s); } else { log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error loading bitmap " "from file [%s]", filename); return 1; } 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; } /*****************************************************************************/ 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_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; LLOGLN(10, ("xrdp_bitmap_copy_box_with_crc: crc16 0x%4.4x", dest->crc16)); LLOGLN(10, ("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) { LLOGLN(10, ("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.x_origin = x; 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; twchar wtext[256]; char text[256]; 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); 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, 18); 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, 18); 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_text_height(painter, self->caption1); 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_text_height(painter, self->caption1); 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) { i = g_mbstowcs(0, self->caption1, 0); g_memset(text, self->password_char, i); text[i] = 0; xrdp_painter_draw_text(painter, self, 4, 2, text); } 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) { wchar_repeat(wtext, 255, self->password_char, self->edit_pos); wtext[self->edit_pos] = 0; g_wcstombs(text, wtext, 255); } else { g_mbstowcs(wtext, self->caption1, 255); wtext[self->edit_pos] = 0; g_wcstombs(text, wtext, 255); } w = xrdp_painter_text_width(painter, text); 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_text_height(painter, "W"); 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_text_height(painter, p); 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) { twchar c; int n; int i; int shift; int ext; int scan_code; int num_bytes; int num_chars; 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 < g_mbstowcs(0, self->caption1, 0)) { self->edit_pos++; xrdp_bitmap_invalidate(self, 0); } } /* backspace */ else if (scan_code == 14) { n = g_mbstowcs(0, self->caption1, 0); if (n > 0) { if (self->edit_pos > 0) { self->edit_pos--; remove_char_at(self->caption1, 255, self->edit_pos); xrdp_bitmap_invalidate(self, 0); } } } /* delete */ else if (scan_code == 83 && (ext || self->wm->num_lock == 0)) { n = g_mbstowcs(0, self->caption1, 0); if (n > 0) { if (self->edit_pos < n) { remove_char_at(self->caption1, 255, self->edit_pos); xrdp_bitmap_invalidate(self, 0); } } } /* end */ else if (scan_code == 79 && (ext || self->wm->num_lock == 0)) { n = g_mbstowcs(0, self->caption1, 0); 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 { 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)); num_chars = g_mbstowcs(0, self->caption1, 0); num_bytes = g_strlen(self->caption1); if ((c >= 32) && (num_chars < 127) && (num_bytes < 250)) { add_char_at(self->caption1, 255, 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.9.12/xrdp/funcs.c000644 001751 001751 00000012214 13544635323 014747 0ustar00metameta000000 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" /*****************************************************************************/ /* 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; } /*****************************************************************************/ /* add a ch at index position in text, index starts at 0 */ /* if index = -1 add it to the end */ int add_char_at(char *text, int text_size, twchar ch, int index) { int len; int i; twchar *wstr; len = g_mbstowcs(0, text, 0); wstr = (twchar *)g_malloc((len + 16) * sizeof(twchar), 0); g_mbstowcs(wstr, text, len + 1); if ((index >= len) || (index < 0)) { wstr[len] = ch; wstr[len + 1] = 0; g_wcstombs(text, wstr, text_size); g_free(wstr); return 0; } for (i = (len - 1); i >= index; i--) { wstr[i + 1] = wstr[i]; } wstr[i + 1] = ch; wstr[len + 1] = 0; g_wcstombs(text, wstr, text_size); g_free(wstr); return 0; } /*****************************************************************************/ /* remove a ch at index position in text, index starts at 0 */ /* if index = -1 remove it from the end */ int remove_char_at(char *text, int text_size, int index) { int len; int i; twchar *wstr; len = g_mbstowcs(0, text, 0); if (len <= 0) { return 0; } wstr = (twchar *)g_malloc((len + 16) * sizeof(twchar), 0); g_mbstowcs(wstr, text, len + 1); if ((index >= (len - 1)) || (index < 0)) { wstr[len - 1] = 0; g_wcstombs(text, wstr, text_size); g_free(wstr); return 0; } for (i = index; i < (len - 1); i++) { wstr[i] = wstr[i + 1]; } wstr[len - 1] = 0; g_wcstombs(text, wstr, text_size); g_free(wstr); return 0; } /*****************************************************************************/ 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; } /*****************************************************************************/ int wchar_repeat(twchar *dest, int dest_size_in_wchars, twchar ch, int repeat) { int index; for (index = 0; index < repeat; index++) { if (index >= dest_size_in_wchars) { break; } dest[index] = ch; } return 0; } xrdp-0.9.12/xrdp/xrdp_encoder.c000644 001751 001751 00000036601 13544635323 016313 0ustar00metameta000000 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 "thread_calls.h" #include "fifo.h" #ifdef XRDP_RFXCODEC #include "rfxcodec_encode.h" #endif #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do \ { \ if (_level < LLOG_LEVEL) \ { \ g_write("xrdp:xrdp_encoder [%10.10u]: ", g_time3()); \ g_writeln _args ; \ } \ } \ while (0) #define XRDP_SURCMD_PREFIX_BYTES 256 /*****************************************************************************/ 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); #endif static int process_enc_h264(struct xrdp_encoder *self, XRDP_ENC_DATA *enc); /*****************************************************************************/ struct xrdp_encoder * xrdp_encoder_create(struct xrdp_mm *mm) { struct xrdp_encoder *self; struct xrdp_client_info *client_info; char buf[1024]; int pid; client_info = mm->wm->client_info; if (client_info->mcs_connection_type != CONNECTION_TYPE_LAN) { return 0; } if (client_info->bpp < 24) { return 0; } self = (struct xrdp_encoder *)g_malloc(sizeof(struct xrdp_encoder), 1); self->mm = mm; if (client_info->jpeg_codec_id != 0) { LLOGLN(0, ("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 */ (32 << 24) | (3 << 16) | (8 << 12) | (8 << 8) | (8 << 4) | 8; self->process_enc = process_enc_jpg; } #ifdef XRDP_RFXCODEC else if (client_info->rfx_codec_id != 0) { LLOGLN(0, ("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 = rfxcodec_encode_create(mm->wm->screen->width, mm->wm->screen->height, RFX_FORMAT_YUV, 0); } #endif else if (client_info->h264_codec_id != 0) { LLOGLN(0, ("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 */ (12 << 24) | (64 << 16) | (0 << 12) | (0 << 8) | (0 << 4) | 0; self->process_enc = process_enc_h264; } else { g_free(self); return 0; } LLOGLN(0, ("init_xrdp_encoder: initializing encoder codec_id %d", self->codec_id)); /* setup required FIFOs */ self->fifo_to_proc = fifo_create(); self->fifo_processed = fifo_create(); 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 = g_create_wait_obj(buf); self->max_compressed_bytes = client_info->max_fastpath_frag_bytes & ~15; self->frames_in_flight = client_info->max_unacknowledged_frame_count; /* 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) { XRDP_ENC_DATA *enc; XRDP_ENC_DATA_DONE *enc_done; FIFO *fifo; LLOGLN(0, ("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); g_sleep(1000); /* todo delete specific encoder */ if (self->process_enc == process_enc_jpg) { } #ifdef XRDP_RFXCODEC else if (self->process_enc == process_enc_rfx) { rfxcodec_encode_destroy(self->codec_handle); } #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); /* cleanup fifo_to_proc */ fifo = self->fifo_to_proc; if (fifo) { while (!fifo_is_empty(fifo)) { enc = (XRDP_ENC_DATA *) fifo_remove_item(fifo); if (enc == 0) { continue; } g_free(enc->drects); g_free(enc->crects); g_free(enc); } fifo_delete(fifo); } /* cleanup fifo_processed */ fifo = self->fifo_processed; if (fifo) { while (!fifo_is_empty(fifo)) { enc_done = (XRDP_ENC_DATA_DONE *) fifo_remove_item(fifo); if (enc_done == 0) { continue; } g_free(enc_done->comp_pad_data); g_free(enc_done); } fifo_delete(fifo); } 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; FIFO *fifo_processed; tbus mutex; tbus event_processed; LLOGLN(10, ("process_enc_jpg:")); quality = self->codec_quality; fifo_processed = self->fifo_processed; mutex = self->mutex; event_processed = self->xrdp_encoder_event_processed; count = enc->num_crects; for (index = 0; index < count; index++) { x = enc->crects[index * 4 + 0]; y = enc->crects[index * 4 + 1]; cx = enc->crects[index * 4 + 2]; cy = enc->crects[index * 4 + 3]; if (cx < 1 || cy < 1) { LLOGLN(0, ("process_enc_jpg: error 1")); continue; } LLOGLN(10, ("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 > 16 * 1024 * 1024)) { LLOGLN(0, ("process_enc_jpg: error 2")); return 1; } out_data = (char *) g_malloc(out_data_bytes + 256 + 2, 0); if (out_data == 0) { LLOGLN(0, ("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->data, enc->width, enc->height, enc->width * 4, x, y, cx, cy, quality, out_data + 256 + 2, &out_data_bytes); if (error < 0) { LLOGLN(0, ("process_enc_jpg: jpeg error %d bytes %d", error, out_data_bytes)); g_free(out_data); return 1; } LLOGLN(10, ("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->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 error; char *out_data; XRDP_ENC_DATA_DONE *enc_done; FIFO *fifo_processed; tbus mutex; tbus event_processed; struct rfx_tile *tiles; struct rfx_rect *rfxrects; int alloc_bytes; LLOGLN(10, ("process_enc_rfx:")); LLOGLN(10, ("process_enc_rfx: num_crects %d num_drects %d", enc->num_crects, enc->num_drects)); fifo_processed = self->fifo_processed; mutex = self->mutex; event_processed = self->xrdp_encoder_event_processed; error = 1; out_data = NULL; out_data_bytes = 0; if ((enc->num_crects > 0) && (enc->num_drects > 0)) { alloc_bytes = XRDP_SURCMD_PREFIX_BYTES; alloc_bytes += self->max_compressed_bytes; alloc_bytes += sizeof(struct rfx_tile) * enc->num_crects + sizeof(struct rfx_rect) * enc->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 + enc->num_crects); count = enc->num_crects; for (index = 0; index < count; index++) { x = enc->crects[index * 4 + 0]; y = enc->crects[index * 4 + 1]; cx = enc->crects[index * 4 + 2]; cy = enc->crects[index * 4 + 3]; tiles[index].x = x; tiles[index].y = y; tiles[index].cx = cx; tiles[index].cy = cy; tiles[index].quant_y = 0; tiles[index].quant_cb = 0; tiles[index].quant_cr = 0; } count = enc->num_drects; for (index = 0; index < count; index++) { x = enc->drects[index * 4 + 0]; y = enc->drects[index * 4 + 1]; cx = enc->drects[index * 4 + 2]; cy = enc->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; error = rfxcodec_encode(self->codec_handle, out_data + XRDP_SURCMD_PREFIX_BYTES, &out_data_bytes, enc->data, enc->width, enc->height, enc->width * 4, rfxrects, enc->num_drects, tiles, enc->num_crects, 0, 0); } } LLOGLN(10, ("process_enc_rfx: rfxcodec_encode rv %d", error)); /* 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 = error == 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->last = 1; enc_done->cx = self->mm->wm->screen->width; enc_done->cy = self->mm->wm->screen->height; /* 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; } #endif /*****************************************************************************/ /* called from encoder thread */ static int process_enc_h264(struct xrdp_encoder *self, XRDP_ENC_DATA *enc) { LLOGLN(0, ("process_enc_x264:")); return 0; } /** * Encoder thread main loop *****************************************************************************/ THREAD_RV THREAD_CC proc_enc_msg(void *arg) { XRDP_ENC_DATA *enc; 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; LLOGLN(0, ("proc_enc_msg: thread is running")); self = (struct xrdp_encoder *) arg; if (self == 0) { LLOGLN(0, ("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_event(); lterm_obj = self->xrdp_encoder_term; 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 */ { LLOGLN(0, ("proc_enc_msg: global term")); break; } if (g_is_wait_obj_set(lterm_obj)) /* xrdp_mm term */ { LLOGLN(0, ("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) */ LLOGLN(0, ("proc_enc_msg: thread exit")); return 0; } xrdp-0.9.12/xrdp/xrdp256.bmp000644 001751 001751 00000140176 13544635323 015410 0ustar00metameta000000 000000 BM~~(  333fff`                                                                                                                                                                                                 xrdp-0.9.12/xrdp/Makefile.am000644 001751 001751 00000003657 13544635323 015534 0ustar00metameta000000 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_PATH=\"${socketdir}\" \ -I$(top_builddir) \ -I$(top_srcdir)/common \ -I$(top_srcdir)/libxrdp XRDP_EXTRA_LIBS = if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif 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_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_wm.c xrdp_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libxrdp/libxrdp.la \ $(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 \ sans-10.fv1 \ cursor0.cur \ cursor1.cur xrdp-0.9.12/xrdp/rdp-scan-codes.txt000644 001751 001751 00000012021 13544635323 017024 0ustar00metameta000000 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.9.12/xrdp/xrdp_cache.c000644 001751 001751 00000056550 13544635323 015744 0ustar00metameta000000 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" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do \ { \ if (_level < LLOG_LEVEL) \ { \ g_write("xrdp:xrdp_cache [%10.10u]: ", g_time3()); \ g_writeln _args ; \ } \ } \ while (0) /*****************************************************************************/ 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); LLOGLN(10, ("xrdp_cache_create: 0 %d 1 %d 2 %d", self->cache1_entries, self->cache2_entries, self->cache3_entries)); return self; } /*****************************************************************************/ void xrdp_cache_delete(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])); } } 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; int i; int j; /* 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); } } /* save these */ wm = self->wm; session = self->session; /* 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 != 0) && (_b2 != 0) && (_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; LLOGLN(10, ("xrdp_cache_update_lru: lru_index %d", lru_index)); if ((lru_index < 0) || (lru_index >= XRDP_MAX_BITMAP_CACHE_IDX)) { LLOGLN(0, ("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; LLOGLN(10, ("xrdp_cache_add_bitmap:")); LLOGLN(10, ("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_message(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); if (COMPARE_WITH_CRC32 (self->bitmap_items[cache_id][cache_idx].bitmap, bitmap)) { LLOGLN(10, ("found bitmap at %d %d", index, 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; LLOGLN(0, ("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); LLOGLN(10, ("xrdp_cache_add_bitmap: oldest %d %d", cache_id, cache_idx)); LLOGLN(10, ("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) { LLOGLN(0, ("xrdp_cache_add_bitmap: error removing cache_idx")); } LLOGLN(10, ("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) { LLOGLN(10, ("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; DEBUG(("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; } } } DEBUG(("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, 32 * 32 * 4) == 0 && g_memcmp(self->pointer_items[i].mask, pointer_item->mask, 32 * 32 / 8) == 0 && self->pointer_items[i].bpp == pointer_item->bpp) { self->pointer_items[i].stamp = self->pointer_stamp; xrdp_wm_set_pointer(self->wm, i); self->wm->current_pointer = i; DEBUG(("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, 32 * 32 * 4); g_memcpy(self->pointer_items[index].mask, pointer_item->mask, 32 * 32 / 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->wm->current_pointer = index; DEBUG(("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, 32 * 32 * 4); g_memcpy(self->pointer_items[index].mask, pointer_item->mask, 32 * 32 / 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->wm->current_pointer = index; DEBUG(("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; DEBUG(("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); DEBUG(("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.9.12/xrdp/cursor0.cur000644 001751 001751 00000000506 13544635323 015576 0ustar00metameta000000 000000  0( @@@@??x0??xrdp-0.9.12/xrdp/ad256.bmp000644 001751 001751 00000046466 13544635323 015026 0ustar00metameta000000 000000 BM6M(L  fff333ff̙fff33ff3ff3f3̙fff̙ff3ff33fffff                                                                                                                                                                                                                                                                                                                                                                                       xrdp-0.9.12/xrdp/xrdp.h000644 001751 001751 00000043320 13544635323 014615 0ustar00metameta000000 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 */ /* 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 g_is_term(void); void g_set_term(int in_val); tbus g_get_term_event(void); tbus g_get_sync_event(void); void g_process_waiting_function(void); void print_version(void); void print_help(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_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 xrdp_wm_pointer(struct xrdp_wm* self, char* data, char* mask, int x, int y, int bpp); int callback(intptr_t id, int msg, intptr_t param1, intptr_t param2, intptr_t param3, intptr_t param4); int xrdp_wm_drdynvc_up(intptr_t id); 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); int xrdp_wm_set_login_mode(struct xrdp_wm* self, int login_mode); /* 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); /* xrdp_bitmap.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); 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_resize(struct xrdp_bitmap* self, int width, int height); int xrdp_bitmap_load(struct xrdp_bitmap* self, const char* filename, int* palette); 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); 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_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); int xrdp_painter_text_height(struct xrdp_painter* self, const char *text); 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_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); void xrdp_font_delete(struct xrdp_font* self); int xrdp_font_item_compare(struct xrdp_font_char* font1, struct xrdp_font_char* font2); /* 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 add_char_at(char* text, int text_size, twchar ch, int index); int remove_char_at(char* text, int text_size, int index); int set_string(char** in_str, const char* in); int wchar_repeat(twchar* dest, int dest_size_in_wchars, twchar ch, int repeat); /* 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); twchar 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); /* xrdp_login_wnd.c */ int xrdp_login_wnd_create(struct xrdp_wm* self); int load_xrdp_config(struct xrdp_config *config, int bpp); /* 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 */ 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); struct xrdp_mm* xrdp_mm_create(struct xrdp_wm* owner); void xrdp_mm_delete(struct xrdp_mm* self); int 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); 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_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_palette(struct xrdp_mod* mod, int* palette); int server_msg(struct xrdp_mod* mod, char* msg, int code); int server_is_term(struct xrdp_mod* mod); int xrdp_child_fork(void); 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 server_reset(struct xrdp_mod* mod, int width, int height, int bpp); int is_channel_allowed(struct xrdp_wm* wm, int channel_id); 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); xrdp-0.9.12/xrdp/lang.c000644 001751 001751 00000022765 13544635323 014566 0ustar00metameta000000 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 "log.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; } /*****************************************************************************/ twchar 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 (twchar)(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 fd; 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_message(LOG_LEVEL_INFO, "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_message(LOG_LEVEL_INFO, "Cannot find keymap file %s", filename); g_snprintf(filename, 255, "%s/km-00000409.ini", XRDP_CFG_PATH); } if (g_file_exist(filename)) { fd = g_file_open(filename); log_message(LOG_LEVEL_INFO, "Loading keymap file %s", filename); if (fd != -1) { 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)); /* clear the keymaps */ g_memset(keymap, 0, sizeof(struct xrdp_keymap)); /* 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); if (g_memcmp(lkeymap, keymap, sizeof(struct xrdp_keymap)) != 0) { log_message(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); g_file_close(fd); } } else { log_message(LOG_LEVEL_WARNING, "File does not exist: %s", filename); } g_free(filename); return 0; } xrdp-0.9.12/xrdp/xrdp_font.c000644 001751 001751 00000013175 13544635323 015643 0ustar00metameta000000 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 */ /* The fv1 files contain Font File Header (just one) FNT1 4 bytes Font Name 32 bytes Font Size 2 bytes Font Style 2 bytes Pad 8 bytes Font Data (repeats) Width 2 bytes Height 2 bytes Baseline 2 bytes Offset 2 bytes Incby 2 bytes Pad 6 bytes Glyph Data var, see FONT_DATASIZE macro */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp.h" #include "log.h" #if 0 /* not used */ static char w_char[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0x80, 0x08, 0x50, 0x80, 0x04, 0x51, 0x00, 0x04, 0x51, 0x00, 0x04, 0x51, 0x00, 0x02, 0x8a, 0x00, 0x02, 0x8a, 0x00, 0x02, 0x8a, 0x00, 0x01, 0x04, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #endif /*****************************************************************************/ struct xrdp_font * xrdp_font_create(struct xrdp_wm *wm) { struct xrdp_font *self; struct stream *s; int fd; int b; int i; int index; int datasize; int file_size; struct xrdp_font_char *f; char file_path[256]; DEBUG(("in xrdp_font_create")); g_snprintf(file_path, 255, "%s/%s", XRDP_SHARE_PATH, DEFAULT_FONT_NAME); if (!g_file_exist(file_path)) { log_message(LOG_LEVEL_ERROR,"xrdp_font_create: error font file [%s] does not exist", file_path); return 0; } file_size = g_file_get_size(file_path); if (file_size < 1) { log_message(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); self->wm = wm; make_stream(s); init_stream(s, file_size + 1024); fd = g_file_open(file_path); if (fd != -1) { b = g_file_read(fd, s->data, file_size + 1024); g_file_close(fd); if (b > 0) { 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_uint8s(s, 8); index = 32; while (s_check_rem(s, 16)) { f = self->font_items + index; in_sint16_le(s, i); f->width = i; in_sint16_le(s, i); f->height = i; in_sint16_le(s, i); f->baseline = i; 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_message(LOG_LEVEL_ERROR,"error in xrdp_font_create, datasize wrong"); log_message(LOG_LEVEL_DEBUG,"width %d height %d datasize %d index %d", f->width, f->height, datasize, index); break; } if (s_check_rem(s, datasize)) { f->data = (char *)g_malloc(datasize, 0); in_uint8a(s, f->data, datasize); } else { log_message(LOG_LEVEL_ERROR,"error in xrdp_font_create"); } index++; } } } 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); */ DEBUG(("out xrdp_font_create")); return self; } /*****************************************************************************/ /* free the font and all the items */ void xrdp_font_delete(struct xrdp_font *self) { int i; if (self == 0) { return; } for (i = 0; i < NUM_FONTS; i++) { g_free(self->font_items[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.9.12/xrdp/ad24b.bmp000644 001751 001751 00000162746 13544635323 015101 0ustar00metameta000000 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.9.12/xrdp/xrdp_types.h000644 001751 001751 00000045731 13544635323 016051 0ustar00metameta000000 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" #define MAX_NR_CHANNELS 16 #define MAX_CHANNEL_NAME 16 /* 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); tintptr mod_dumby[100 - 11]; /* 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, char* msg, int code); int (*server_is_term)(struct xrdp_mod* v); 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 (*server_reset)(struct xrdp_mod* v, int width, int height, int bpp); 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); /* 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); tintptr server_dumby[100 - 44]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as int */ tintptr wm; /* struct xrdp_wm* */ tintptr painter; tintptr si; }; /* 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; char data[32 * 32 * 4]; char mask[32 * 32 / 8]; int bpp; }; 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; struct xrdp_mm { struct xrdp_wm* wm; /* owner */ int connected_state; /* true if connected to sesman else false */ struct trans* sesman_trans; /* connection to sesman */ int sesman_trans_up; /* true once connected to sesman */ int delete_sesman_trans; /* boolean set when done with sesman connection */ 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 code; /* 0=Xvnc session, 10=X11rdp session, 20=xorg driver mode */ int sesman_controlled; /* true if this is a sesman session */ struct trans* chan_trans; /* connection to chansrv */ int chan_trans_up; /* true once connected to chansrv */ int delete_chan_trans; /* boolean set when done with channel connection */ int usechansrv; /* true if chansrvport is set in xrdp.ini or using sesman */ struct xrdp_encoder *encoder; int cs2xr_cid_map[256]; int xr2cr_cid_map[256]; }; struct xrdp_key_info { int sym; int 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 */ 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; int login_mode; tbus login_mode_event; struct xrdp_mm* mm; struct xrdp_font* default_font; struct xrdp_keymap keymap; int hide_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; }; /* 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; twchar 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 NUM_FONTS 0x4e00 #define DEFAULT_FONT_NAME "sans-10.fv1" #define DEFAULT_ELEMENT_TOP 35 #define DEFAULT_BUTTON_W 60 #define DEFAULT_BUTTON_H 23 #define DEFAULT_COMBO_H 21 #define DEFAULT_EDIT_H 21 #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; struct xrdp_font_char font_items[NUM_FONTS]; char name[32]; int size; int style; }; /* module */ struct xrdp_mod_data { struct list* names; struct list* values; }; struct xrdp_startup_params { char port[1024]; int kill; int no_daemon; int help; int version; int fork; int tcp_send_buffer_bytes; int tcp_recv_buffer_bytes; int tcp_nodelay; int tcp_keepalive; int use_vsock; }; /* * For storing xrdp.ini configuration settings */ 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; /* colors */ int grey; int black; int dark_grey; int blue; int dark_blue; int white; int red; int green; int background; /* login screen */ int ls_top_window_bg_color; /* top level window background color */ int ls_width; /* window width */ int ls_height; /* window height */ int ls_bg_color; /* background color */ char ls_logo_filename[256]; /* logo filename */ char ls_background_image[256]; /* background image file name */ int ls_logo_x_pos; /* logo x co-ordinate */ int ls_logo_y_pos; /* logo y co-ordinate */ int ls_label_x_pos; /* x pos of labels */ int ls_label_width; /* width of labels */ int ls_input_x_pos; /* x pos of text and combo boxes */ int ls_input_width; /* width of input and combo boxes */ int ls_input_y_pos; /* y pos for for first label and combo box */ int ls_btn_ok_x_pos; /* x pos for OK button */ int ls_btn_ok_y_pos; /* y pos for OK button */ int ls_btn_ok_width; /* width of OK button */ int ls_btn_ok_height; /* height of OK button */ int ls_btn_cancel_x_pos; /* x pos for Cancel button */ int ls_btn_cancel_y_pos; /* y pos for Cancel button */ int ls_btn_cancel_width; /* width of Cancel button */ int ls_btn_cancel_height; /* height of Cancel button */ char ls_title[256]; /* loginscreen window title */ }; 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.9.12/xrdp/Makefile.in000644 001751 001751 00000070561 13601646126 015540 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG @XRDP_RFXCODEC_TRUE@am__append_2 = -DXRDP_RFXCODEC \ @XRDP_RFXCODEC_TRUE@ -I$(top_srcdir)/librfxcodec/include @XRDP_RFXCODEC_TRUE@am__append_3 = $(top_builddir)/librfxcodec/src/.libs/librfxencode.a @XRDP_PIXMAN_TRUE@am__append_4 = -DXRDP_PIXMAN $(PIXMAN_CFLAGS) @XRDP_PIXMAN_TRUE@am__append_5 = $(PIXMAN_LIBS) @XRDP_PAINTER_TRUE@am__append_6 = -DXRDP_PAINTER \ @XRDP_PAINTER_TRUE@ -I$(top_srcdir)/libpainter/include @XRDP_PAINTER_TRUE@am__append_7 = $(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_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_wm.$(OBJEXT) xrdp_OBJECTS = $(am_xrdp_OBJECTS) am__DEPENDENCIES_1 = @XRDP_PIXMAN_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) am__DEPENDENCIES_3 = $(am__append_3) $(am__DEPENDENCIES_2) \ $(am__append_7) xrdp_DEPENDENCIES = $(top_builddir)/common/libcommon.la \ $(top_builddir)/libxrdp/libxrdp.la $(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_cache.Po ./$(DEPDIR)/xrdp_encoder.Po \ ./$(DEPDIR)/xrdp_font.Po ./$(DEPDIR)/xrdp_listen.Po \ ./$(DEPDIR)/xrdp_login_wnd.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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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_PATH=\"${socketdir}\" -I$(top_builddir) \ -I$(top_srcdir)/common -I$(top_srcdir)/libxrdp $(am__append_1) \ $(am__append_2) $(am__append_4) $(am__append_6) XRDP_EXTRA_LIBS = $(am__append_3) $(am__append_5) $(am__append_7) xrdp_SOURCES = \ funcs.c \ lang.c \ xrdp.c \ xrdp.h \ xrdp_bitmap.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_wm.c xrdp_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libxrdp/libxrdp.la \ $(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 \ sans-10.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)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list 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_cache.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_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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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_cache.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_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_cache.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_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: xrdp-0.9.12/xrdp/xrdp_process.c000644 001751 001751 00000021542 13544635323 016350 0ustar00metameta000000 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)) { DEBUG(("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 create and wm::login_mode is zero and login_mode_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; DEBUG(("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) { g_writeln("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 > 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) { g_writeln("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 > 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) { g_writeln("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; DEBUG(("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->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_event(); 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 */ { 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 { g_writeln("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); libxrdp_exit(self->session); self->session = 0; self->status = -1; g_set_wait_obj(self->done_event); return 0; } xrdp-0.9.12/xrdp/xrdp_painter.c000644 001751 001751 00000126274 13544635323 016344 0ustar00metameta000000 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 "xrdp.h" #if defined(XRDP_PAINTER) #include /* libpainter */ #endif #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do \ { \ if (_level < LLOG_LEVEL) \ { \ g_write("xrdp:xrdp_painter [%10.10u]: ", g_time3()); \ g_writeln _args ; \ } \ } \ while (0) #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); LLOGLN(10, ("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; LLOGLN(10, ("xrdp_painter_send_dirty:")); bpp = self->wm->screen->bpp; Bpp = (bpp + 7) / 8; if (Bpp == 3) { Bpp = 4; } 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; } LLOGLN(10, ("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; LLOGLN(10, ("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) { #if defined(XRDP_PAINTER) if (painter_create(&(self->painter)) != PT_ERROR_NONE) { self->painter = 0; LLOGLN(0, ("xrdp_painter_create: painter_create failed")); } else { LLOGLN(10, ("xrdp_painter_create: painter_create success")); } self->dirty_region = xrdp_region_create(wm); #endif } return self; } /*****************************************************************************/ void xrdp_painter_delete(struct xrdp_painter *self) { LLOGLN(10, ("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; LLOGLN(10, ("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 { g_writeln("xrdp_painter_begin_update: bad target_surface"); } return 0; } /*****************************************************************************/ int xrdp_painter_begin_update(struct xrdp_painter *self) { LLOGLN(10, ("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) { LLOGLN(10, ("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) { int index; int rv; int len; struct xrdp_font_char *font_item; twchar *wstr; LLOGLN(10, ("xrdp_painter_text_width:")); xrdp_painter_font_needed(self); if (self->font == 0) { return 0; } if (text == 0) { return 0; } rv = 0; len = g_mbstowcs(0, text, 0); wstr = (twchar *)g_malloc((len + 2) * sizeof(twchar), 0); g_mbstowcs(wstr, text, len + 1); for (index = 0; index < len; index++) { font_item = self->font->font_items + wstr[index]; rv = rv + font_item->incby; } g_free(wstr); return rv; } /*****************************************************************************/ int xrdp_painter_text_height(struct xrdp_painter *self, const char *text) { int index; int rv; int len; struct xrdp_font_char *font_item; twchar *wstr; LLOGLN(10, ("xrdp_painter_text_height:")); xrdp_painter_font_needed(self); if (self->font == 0) { return 0; } if (text == 0) { return 0; } rv = 0; len = g_mbstowcs(0, text, 0); wstr = (twchar *)g_malloc((len + 2) * sizeof(twchar), 0); g_mbstowcs(wstr, text, len + 1); for (index = 0; index < len; index++) { font_item = self->font->font_items + wstr[index]; rv = MAX(rv, font_item->height); } g_free(wstr); return rv; } /*****************************************************************************/ static int xrdp_painter_setup_brush(struct xrdp_painter *self, struct xrdp_brush *out_brush, struct xrdp_brush *in_brush) { int cache_id; LLOGLN(10, ("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; LLOGLN(10, ("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; LLOGLN(10, ("xrdp_painter_fill_rect: dst->type %d", dst->type)); if (dst->type != WND_TYPE_OFFSCREEN) { LLOGLN(10, ("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; LLOGLN(10, ("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; } /*****************************************************************************/ int xrdp_painter_draw_text(struct xrdp_painter *self, struct xrdp_bitmap *dst, int x, int y, const char *text) { int i; int f; int c; int k; int x1; int y1; int flags; int len; 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; twchar *wstr; LLOGLN(10, ("xrdp_painter_draw_text:")); if (self == 0) { return 0; } len = g_mbstowcs(0, text, 0); if (len < 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; /* convert to wide char */ wstr = (twchar *)g_malloc((len + 2) * sizeof(twchar), 0); g_mbstowcs(wstr, text, len + 1); font = self->font; total_width = 0; total_height = 0; for (index = 0; index < len; index++) { font_item = font->font_items + wstr[index]; k = font_item->incby; total_width += k; total_height = MAX(total_height, font_item->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 < len; index++) { font_item = font->font_items + wstr[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_item->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, x, y, font_item->width, font_item->height, &draw_rect); x += font_item->incby; } } k++; } painter_clear_clip(self->painter); xrdp_region_delete(region); g_free(wstr); } return 0; #endif } /* convert to wide char */ wstr = (twchar *)g_malloc((len + 2) * sizeof(twchar), 0); g_mbstowcs(wstr, text, len + 1); font = self->font; f = 0; k = 0; total_width = 0; total_height = 0; data = (char *)g_malloc(len * 4, 1); for (index = 0; index < len; index++) { font_item = font->font_items + wstr[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; total_height = MAX(total_height, font_item->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 + total_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, len * 2, &draw_rect); } k++; } xrdp_region_delete(region); g_free(data); g_free(wstr); return 0; } /*****************************************************************************/ 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; LLOGLN(0, ("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_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; LLOGLN(10, ("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; LLOGLN(10, ("xrdp_painter_copy: src->type %d dst->type %d", src->type, dst->type)); LLOGLN(10, ("xrdp_painter_copy: self->rop 0x%2.2x", self->rop)); if (dst->type != WND_TYPE_OFFSCREEN) { LLOGLN(10, ("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); LLOGLN(10, (" 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) { //g_writeln("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) { //g_writeln("off screen to screen"); xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy, region, self->clip_children); } else { //g_writeln("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) { g_writeln("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; LLOGLN(0, ("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; LLOGLN(10, ("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; LLOGLN(10, ("xrdp_painter_line: dst->type %d", dst->type)); LLOGLN(10, ("xrdp_painter_line: self->rop 0x%2.2x", self->rop)); if (dst->type != WND_TYPE_OFFSCREEN) { LLOGLN(10, ("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.9.12/libpainter/README000644 001751 001751 00000000000 13017426060 015476 0ustar00metameta000000 000000 xrdp-0.9.12/libpainter/config.guess000755 001751 001751 00000126014 13601646113 017156 0ustar00metameta000000 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.9.12/libpainter/NEWS000644 001751 001751 00000000000 13017426060 015315 0ustar00metameta000000 000000 xrdp-0.9.12/libpainter/install-sh000755 001751 001751 00000036010 13601646113 016636 0ustar00metameta000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # 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 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 the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? 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 '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac 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 && $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 # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook '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.9.12/libpainter/aclocal.m4000644 001751 001751 00000122423 13601646112 016475 0ustar00metameta000000 000000 # generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 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.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 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-2018 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-2018 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 thusly: # 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-2018 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. 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-2018 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 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_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # 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 ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 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-2018 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-2018 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-2018 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 case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac 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-2018 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-2018 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) 2001-2018 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-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 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-2018 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-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/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.9.12/libpainter/ltmain.sh000644 001751 001751 00001170771 13601646111 016466 0ustar00metameta000000 000000 #! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 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.6 package_revision=2.4.6 ## ------ ## ## 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=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 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. # 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. # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## 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 # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # 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 ## ------------------------- ## ## 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" ## ----------------- ## ## 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_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_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_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg 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. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # 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_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_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_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_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 # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 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. # 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## 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 '# warranty; '. # # 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 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 # to the main code. A hook is just a named list of of function, 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 functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is 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 funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # 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=: ;; # # 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 # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # 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_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse 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 [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_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 propogate 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+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # 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+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break 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 ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # 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+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## 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#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' 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. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # 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: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # 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.6 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= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _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; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } 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_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_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_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_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_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_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 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 -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_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_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_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_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_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$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\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $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_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in 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 ;; 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*) # 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*) # 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 ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-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_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # 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 # -stdlib=* select c++ std lib with clang -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=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_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_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_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_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test 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|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) 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*) # 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_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test 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_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test 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_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do 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_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` 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.9.12/libpainter/AUTHORS000644 001751 001751 00000000000 13017426060 015666 0ustar00metameta000000 000000 xrdp-0.9.12/libpainter/src/000755 001751 001751 00000000000 13601646134 015424 5ustar00metameta000000 000000 xrdp-0.9.12/libpainter/compile000755 001751 001751 00000016327 13601646113 016221 0ustar00metameta000000 000000 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 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*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]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.9.12/libpainter/Makefile.am000644 001751 001751 00000000245 13127342056 016671 0ustar00metameta000000 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.9.12/libpainter/include/000755 001751 001751 00000000000 13601646134 016260 5ustar00metameta000000 000000 xrdp-0.9.12/libpainter/missing000755 001751 001751 00000015336 13601646113 016241 0ustar00metameta000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: xrdp-0.9.12/libpainter/configure000755 001751 001751 00001517072 13601646113 016556 0ustar00metameta000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libpainter 0.1.1. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 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 -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_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 exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && 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 as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else 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 test -z "$as_dir" && as_dir=. 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_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS 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'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$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 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=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" 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_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS PT_TESTS_FALSE PT_TESTS_TRUE pkgconfigdir CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP 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_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V 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 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 CPP' # 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' 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 # Accept the important Cygnus configure options, so we can diagnose typos. 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=`$as_echo "$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=`$as_echo "$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 ;; -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=`$as_echo "$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=`$as_echo "$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. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` 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" ;; *) $as_echo "$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 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 || $as_echo 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] --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. CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$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.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF 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 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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_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$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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # 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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status 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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #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 (); /* 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 () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func 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.69. Invocation command line was $ $0 $@ _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 test -z "$as_dir" && as_dir=. $as_echo "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=`$as_echo "$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=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$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 $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$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=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`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.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. 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=`$as_echo "$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 case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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 (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." 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' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # 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 -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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. $as_echo "$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\"" $as_echo "$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 $as_echo "$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 () { ; 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$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+set}" = set && 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 ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$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 () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -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 **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF 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 test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "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.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' 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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". 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 thusly: # 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #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}; /* AIX 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; } { /* AIX 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 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "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*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$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+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else 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 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else 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* | 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 fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #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 fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$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}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else 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='/usr/bin/file -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*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-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=/usr/bin/file 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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=$? $as_echo "$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=$? $as_echo "$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.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # 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++, # 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=$? $as_echo "$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=$? $as_echo "$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=$? $as_echo "$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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no 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|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else 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" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$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+set}" = set; 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else 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 cru libconftest.a conftest.o" >&5 $AR cru 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$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*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test 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_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "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 ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue 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 # Passes both tests. ac_preproc_ok=: break 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 fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue 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 # Passes both tests. ac_preproc_ok=: break 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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : 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 : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; 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 enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; 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 enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; 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 pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; 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 enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; 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 if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF 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, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$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\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "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++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) 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 ;; 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 == "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 ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi 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 ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi 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++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC 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 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*) 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) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else 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 lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$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 ;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $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=$? $as_echo "$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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "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*) # Native MSVC 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 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*) # 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 ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; 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$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$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 lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$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 fi fi fi fi 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else 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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$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\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else 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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$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+set}" = set; then : withval=$with_pkgconfigdir; else with_pkgconfigdir='${libdir}/pkgconfig' fi pkgconfigdir=$with_pkgconfigdir # Use silent rules by default if supported by Automake # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5 $as_echo_n "checking CFLAGS for maximum warnings... " >&6; } if ${ac_cv_cflags_warn_all+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; 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.$ac_ext done CFLAGS="$ac_save_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 $as_echo "$ac_cv_cflags_warn_all" >&6; } case ".$ac_cv_cflags_warn_all" in .ok|.ok,*) ;; .|.no|.no,*) ;; *) if ${CFLAGS+:} false; then : case " $CFLAGS " in #( *" $ac_cv_cflags_warn_all "*) : { { $as_echo "$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $ac_cv_cflags_warn_all" { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else CFLAGS=$ac_cv_cflags_warn_all { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 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=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in #( *" $flag "*) : { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $flag" { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else CFLAGS=$flag { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi else : fi done # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then : enableval=$enable_tests; else enable_tests=no 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$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+set}" = set || &/ 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 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$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=`$as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' 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" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$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 -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _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.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _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 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libpainter config.status 0.1.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$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 ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$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 ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _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 \$as_echo "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 $as_echo "$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"`' 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"`' 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 \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ 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+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason 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=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _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@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _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"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && 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 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$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 $as_echo "/* $configure_input */" \ && 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 || $as_echo 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) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # 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=`$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" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo 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 || $as_echo 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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. 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 # 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. AR_FLAGS=$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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi xrdp-0.9.12/libpainter/tests/000755 001751 001751 00000000000 13601646134 015777 5ustar00metameta000000 000000 xrdp-0.9.12/libpainter/depcomp000755 001751 001751 00000056020 13601646113 016212 0ustar00metameta000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 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 . EOF exit $? ;; -v | --v*) echo "depcomp $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 digits=0123456789 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 interferences 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 obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB 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.9.12/libpainter/ChangeLog000644 001751 001751 00000000000 13017426060 016370 0ustar00metameta000000 000000 xrdp-0.9.12/libpainter/configure.ac000644 001751 001751 00000001524 13127342056 017124 0ustar00metameta000000 000000 # Process this file with autoconf to produce a configure script AC_PREREQ(2.59) 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 AC_PROG_LIBTOOL 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.9.12/libpainter/Makefile.in000644 001751 001751 00000062354 13601646113 016711 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = src include pkgconfig tests am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config_ac-h.in \ AUTHORS ChangeLog NEWS README 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 -200 -exec chmod u+w {} ';' \ && 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 = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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 @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config_ac.h $(srcdir)/config_ac-h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 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) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @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-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ 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) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-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 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: xrdp-0.9.12/libpainter/pkgconfig/000755 001751 001751 00000000000 13601646134 016604 5ustar00metameta000000 000000 xrdp-0.9.12/libpainter/config_ac-h.in000644 001751 001751 00000003231 13601646113 017316 0ustar00metameta000000 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_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* 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 you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const xrdp-0.9.12/libpainter/m4/000755 001751 001751 00000000000 13601646134 015155 5ustar00metameta000000 000000 xrdp-0.9.12/libpainter/bootstrap000755 001751 001751 00000000605 13035113356 016575 0ustar00metameta000000 000000 #!/bin/sh which autoconf if ! test $? -eq 0 then echo "error, install autoconf" exit 1 fi which automake if ! test $? -eq 0 then echo "error, install automake" exit 1 fi which libtool || which libtoolize if ! test $? -eq 0 then echo "error, install libtool" exit 1 fi which pkg-config if ! test $? -eq 0 then echo "error, install pkg-config" exit 1 fi autoreconf -fvi xrdp-0.9.12/libpainter/config.sub000755 001751 001751 00000105526 13601646113 016626 0ustar00metameta000000 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.9.12/libpainter/m4/lt~obsolete.m4000644 001751 001751 00000013774 13601646111 020000 0ustar00metameta000000 000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 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.9.12/libpainter/m4/ltversion.m4000644 001751 001751 00000001273 13601646111 017442 0ustar00metameta000000 000000 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 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 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) xrdp-0.9.12/libpainter/m4/ltoptions.m4000644 001751 001751 00000034262 13601646111 017454 0ustar00metameta000000 000000 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 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.9.12/libpainter/m4/ax_check_compile_flag.m4000644 001751 001751 00000006403 13127342056 021667 0ustar00metameta000000 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.9.12/libpainter/m4/ax_append_compile_flags.m4000644 001751 001751 00000005660 13127342056 022250 0ustar00metameta000000 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.9.12/libpainter/m4/libtool.m4000644 001751 001751 00001125073 13601646111 017067 0ustar00metameta000000 000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 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 58 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_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, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_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 cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru 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*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test 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], [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 `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out 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 `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; 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 `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file 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 `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file 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 `/usr/bin/file 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} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [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* | 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 -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_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*) # Native MSVC 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 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*) # 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='/usr/bin/file -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*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-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=/usr/bin/file 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++, # 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*) # 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 == "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*) _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++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) 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 ;; 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 == "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++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _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 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*) _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 ;; 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*) # Native MSVC # 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 ;; 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*) # 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_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.9.12/libpainter/m4/ax_append_flag.m4000644 001751 001751 00000005333 13127342056 020352 0ustar00metameta000000 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.9.12/libpainter/m4/pkg.m4000644 001751 001751 00000024011 13035113356 016172 0ustar00metameta000000 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.9.12/libpainter/m4/ltsugar.m4000644 001751 001751 00000010440 13601646111 017072 0ustar00metameta000000 000000 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 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.9.12/libpainter/m4/ax_cflags_warn_all.m4000644 001751 001751 00000011703 13127342056 021226 0ustar00metameta000000 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.9.12/libpainter/m4/ax_require_defined.m4000644 001751 001751 00000002302 13127342056 021235 0ustar00metameta000000 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.9.12/libpainter/pkgconfig/libpainter.pc.in000644 001751 001751 00000000351 13035113356 021661 0ustar00metameta000000 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.9.12/libpainter/pkgconfig/libpainter-uninstalled.pc.in000644 001751 001751 00000000437 13035113356 024206 0ustar00metameta000000 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.9.12/libpainter/pkgconfig/Makefile.in000644 001751 001751 00000035166 13601646113 020661 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/libpainter/pkgconfig/Makefile.am000644 001751 001751 00000000037 13035113356 020634 0ustar00metameta000000 000000 pkgconfig_DATA = libpainter.pc xrdp-0.9.12/libpainter/tests/Makefile.in000644 001751 001751 00000047570 13601646114 020057 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/libpainter/tests/Makefile.am000644 001751 001751 00000000454 13061652764 020044 0ustar00metameta000000 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.9.12/libpainter/tests/paintertest.c000644 001751 001751 00000000250 13061652764 020510 0ustar00metameta000000 000000 #if defined(HAVE_CONFIG_H) #include #endif #include #include #include int main(int argc, char **argv) { return 0; } xrdp-0.9.12/libpainter/include/Makefile.in000644 001751 001751 00000040406 13601646113 020326 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/libpainter/include/Makefile.am000644 001751 001751 00000000053 13035113356 020306 0ustar00metameta000000 000000 EXTRA_DIST = include_HEADERS = painter.h xrdp-0.9.12/libpainter/include/painter.h000644 001751 001751 00000007664 13035113356 020104 0ustar00metameta000000 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.9.12/libpainter/src/painter_utils.h000644 001751 001751 00000006717 12772745511 020501 0ustar00metameta000000 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.9.12/libpainter/src/painter.c000644 001751 001751 00000026426 13061652764 017252 0ustar00metameta000000 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.9.12/libpainter/src/painter_utils.c000644 001751 001751 00000020174 13061652764 020464 0ustar00metameta000000 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.9.12/libpainter/src/Makefile.in000644 001751 001751 00000051170 13601646113 017472 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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 = 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: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/libpainter/src/Makefile.am000644 001751 001751 00000000545 13035113356 017460 0ustar00metameta000000 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 = libpainter_ladir = $(moduledir) libpainter_la_SOURCES = painter.c painter_utils.c painter_utils.h libpainter_la_LIBADD = xrdp-0.9.12/sesman/xauth.c000644 001751 001751 00000003050 13544635323 015271 0ustar00metameta000000 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" /******************************************************************************/ 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_message(LOG_LEVEL_ERROR, "Unable to launch xauth"); return 1; } ret = pclose(dp); if (ret < 0) { log_message(LOG_LEVEL_ERROR, "An error occurred while running xauth"); return 1; } return 0; } xrdp-0.9.12/sesman/session.h000644 001751 001751 00000006650 13544635323 015641 0ustar00metameta000000 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 "libscp_types.h" #define SESMAN_SESSION_TYPE_XRDP 1 #define SESMAN_SESSION_TYPE_XVNC 2 #define SESMAN_SESSION_TYPE_XORG 3 #define SESMAN_SESSION_STATUS_ACTIVE 0x01 #define SESMAN_SESSION_STATUS_IDLE 0x02 #define SESMAN_SESSION_STATUS_DISCONNECTED 0x04 /* future expansion #define SESMAN_SESSION_STATUS_REMCONTROL 0x08 */ #define SESMAN_SESSION_STATUS_ALL 0xFF #define SESMAN_SESSION_KILL_OK 0 #define SESMAN_SESSION_KILL_NULLITEM 1 #define SESMAN_SESSION_KILL_NOTFOUND 2 struct session_date { tui16 year; tui8 month; tui8 day; tui8 hour; tui8 minute; }; #define zero_time(s) { (s)->year=0; (s)->month=0; (s)->day=0; (s)->hour=0; (s)->minute=0; } struct session_item { char name[256]; int pid; /* pid of sesman waiting for wm to end */ int display; int width; int height; int bpp; long data; /* status info */ unsigned char status; unsigned char type; /* time data */ struct session_date connect_time; struct session_date disconnect_time; struct session_date idle_time; char client_ip[256]; tui8 guid[16]; }; struct session_chain { struct session_chain* next; struct session_item* item; }; /** * * @brief finds a session matching the supplied parameters * @return session data or 0 * */ struct session_item* session_get_bydata(const char *name, int width, int height, int bpp, int type, const char *client_ip); #ifndef session_find_item #define session_find_item(a, b, c, d, e, f) session_get_bydata(a, b, c, d, e, f); #endif /** * * @brief starts a session * @return 0 on error, display number if success * */ int session_start(long data, tui8 type, struct SCP_CONNECTION *c, struct SCP_SESSION *s); int session_reconnect(int display, char *username, long data); /** * * @brief kills a session * @param pid the pid of the session to be killed * @return * */ int session_kill(int pid); /** * * @brief sends sigkill to all sessions * @return * */ void session_sigkill_all(void); /** * * @brief retrieves a session's descriptor * @param pid the session pid * @return a pointer to the session descriptor on success, NULL otherwise * */ struct session_item* session_get_bypid(int pid); /** * * @brief retrieves a session's descriptor * @param pid the session pid * @return a pointer to the session descriptor on success, NULL otherwise * */ struct SCP_DISCONNECTED_SESSION* session_get_byuser(const char *user, int *cnt, unsigned char flags); /** * * @brief delete socket files * @param display number * @return non-zero value (number of errors) if failed */ int cleanup_sockets(int display); #endif xrdp-0.9.12/sesman/verify_user_pam.c000644 001751 001751 00000017717 13544635323 017356 0ustar00metameta000000 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 #include struct t_user_pass { char user[256]; char pass[256]; }; struct t_auth_info { struct t_user_pass user_pass; int session_opened; int did_setcred; struct pam_conv pamc; pam_handle_t *ph; }; /******************************************************************************/ 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; struct t_user_pass *user_pass; reply = g_new0(struct pam_response, num_msg); for (i = 0; i < num_msg; i++) { switch (msg[i]->msg_style) { case PAM_PROMPT_ECHO_ON: /* username */ user_pass = (struct t_user_pass *) appdata_ptr; reply[i].resp = g_strdup(user_pass->user); reply[i].resp_retcode = PAM_SUCCESS; break; case PAM_PROMPT_ECHO_OFF: /* password */ user_pass = (struct t_user_pass *) appdata_ptr; reply[i].resp = g_strdup(user_pass->pass); reply[i].resp_retcode = PAM_SUCCESS; break; default: g_printf("unknown in verify_pam_conv\r\n"); g_free(reply); return PAM_CONV_ERR; } } *resp = reply; return PAM_SUCCESS; } /******************************************************************************/ static void get_service_name(char *service_name) { service_name[0] = 0; if (g_file_exist("/etc/pam.d/xrdp-sesman") || g_file_exist(XRDP_SYSCONF_PATH "/pam.d/xrdp-sesman")) { g_strncpy(service_name, "xrdp-sesman", 255); } else { g_strncpy(service_name, "gdm", 255); } } /******************************************************************************/ /* returns long, zero is no go Stores the detailed error code in the errorcode variable*/ long auth_userpass(const char *user, const char *pass, int *errorcode) { int error; struct t_auth_info *auth_info; char service_name[256]; get_service_name(service_name); auth_info = g_new0(struct t_auth_info, 1); g_strncpy(auth_info->user_pass.user, user, 255); g_strncpy(auth_info->user_pass.pass, pass, 255); auth_info->pamc.conv = &verify_pam_conv; auth_info->pamc.appdata_ptr = &(auth_info->user_pass); error = pam_start(service_name, 0, &(auth_info->pamc), &(auth_info->ph)); if (error != PAM_SUCCESS) { if (errorcode != NULL) { *errorcode = error; } g_printf("pam_start failed: %s\r\n", pam_strerror(auth_info->ph, error)); pam_end(auth_info->ph, error); g_free(auth_info); return 0; } error = pam_set_item(auth_info->ph, PAM_TTY, service_name); if (error != PAM_SUCCESS) { g_printf("pam_set_item failed: %s\r\n", pam_strerror(auth_info->ph, error)); } error = pam_authenticate(auth_info->ph, 0); if (error != PAM_SUCCESS) { if (errorcode != NULL) { *errorcode = error; } g_printf("pam_authenticate failed: %s\r\n", pam_strerror(auth_info->ph, error)); pam_end(auth_info->ph, error); g_free(auth_info); return 0; } /* 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. */ error = pam_acct_mgmt(auth_info->ph, 0); if (error != PAM_SUCCESS) { if (errorcode != NULL) { *errorcode = error; } g_printf("pam_acct_mgmt failed: %s\r\n", pam_strerror(auth_info->ph, error)); pam_end(auth_info->ph, error); g_free(auth_info); return 0; } return (long)auth_info; } /******************************************************************************/ /* returns error */ int auth_start_session(long in_val, int in_display) { struct t_auth_info *auth_info; int error; char display[256]; g_sprintf(display, ":%d", in_display); auth_info = (struct t_auth_info *)in_val; error = pam_set_item(auth_info->ph, PAM_TTY, display); if (error != PAM_SUCCESS) { g_printf("pam_set_item failed: %s\r\n", pam_strerror(auth_info->ph, error)); return 1; } error = pam_setcred(auth_info->ph, PAM_ESTABLISH_CRED); if (error != PAM_SUCCESS) { g_printf("pam_setcred failed: %s\r\n", 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) { g_printf("pam_open_session failed: %s\r\n", pam_strerror(auth_info->ph, error)); return 1; } auth_info->session_opened = 1; return 0; } /******************************************************************************/ /* returns error */ int auth_stop_session(long in_val) { struct t_auth_info *auth_info; int error; auth_info = (struct t_auth_info *)in_val; error = pam_close_session(auth_info->ph, 0); if (error != PAM_SUCCESS) { g_printf("pam_close_session failed: %s\r\n", pam_strerror(auth_info->ph, error)); return 1; } auth_info->session_opened = 0; return 0; } /******************************************************************************/ /* returns error */ /* cleanup */ int auth_end(long in_val) { struct t_auth_info *auth_info; auth_info = (struct t_auth_info *)in_val; if (auth_info != 0) { if (auth_info->ph != 0) { if (auth_info->session_opened) { pam_close_session(auth_info->ph, 0); } if (auth_info->did_setcred) { pam_setcred(auth_info->ph, PAM_DELETE_CRED); } 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(long in_val) { struct t_auth_info *auth_info; char **pam_envlist; char **pam_env; char item[256]; char value[256]; int eq_pos; auth_info = (struct t_auth_info *)in_val; if (auth_info != 0) { /* export PAM environment */ pam_envlist = pam_getenvlist(auth_info->ph); if (pam_envlist != NULL) { for (pam_env = pam_envlist; *pam_env != NULL; ++pam_env) { eq_pos = g_pos(*pam_env, "="); if (eq_pos >= 0 && eq_pos < 250) { g_strncpy(item, *pam_env, eq_pos); g_strncpy(value, (*pam_env) + eq_pos + 1, 255); g_setenv(item, value, 1); } g_free(*pam_env); } g_free(pam_envlist); } } return 0; } xrdp-0.9.12/sesman/startwm.sh000755 001751 001751 00000004201 13544635323 016033 0ustar00metameta000000 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 ~/.bash_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 loging 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 } #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 . /etc/X11/Xsession post_start exit 0 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 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.9.12/sesman/verify_user_kerberos.c000644 001751 001751 00000024745 13544635323 020414 0ustar00metameta000000 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 "os_calls.h" #include typedef enum { INIT_PW, INIT_KT, RENEW, VALIDATE } action_type; struct k_opts { /* in seconds */ krb5_deltat starttime; krb5_deltat lifetime; krb5_deltat rlife; int forwardable; int proxiable; int addresses; int not_forwardable; int not_proxiable; int no_addresses; int verbose; char *principal_name; char *service_name; char *keytab_name; char *k5_cache_name; char *k4_cache_name; action_type action; }; struct k5_data { krb5_context ctx; krb5_ccache cc; krb5_principal me; char *name; }; struct user_info { const char *name; const char *pass; }; /******************************************************************************/ /* returns boolean */ static int k5_begin(struct k_opts *opts, struct k5_data *k5, struct user_info *u_info) { krb5_error_code code = 0; code = krb5_init_context(&k5->ctx); if (code != 0) { g_printf("krb5_init_context failed in k5_begin\n"); return 0; } if (opts->k5_cache_name) { code = krb5_cc_resolve(k5->ctx, opts->k5_cache_name, &k5->cc); if (code != 0) { g_printf("krb5_cc_resolve failed in k5_begin\n"); return 0; } } else { code = krb5_cc_default(k5->ctx, &k5->cc); if (code != 0) { g_printf("krb5_cc_default failed in k5_begin\n"); return 0; } } if (opts->principal_name) { /* Use specified name */ code = krb5_parse_name(k5->ctx, opts->principal_name, &k5->me); if (code != 0) { g_printf("krb5_parse_name failed in k5_begin\n"); return 0; } } else { /* No principal name specified */ if (opts->action == INIT_KT) { /* Use the default host/service name */ code = krb5_sname_to_principal(k5->ctx, NULL, NULL, KRB5_NT_SRV_HST, &k5->me); if (code != 0) { g_printf("krb5_sname_to_principal failed in k5_begin\n"); return 0; } } else { /* Get default principal from cache if one exists */ code = krb5_cc_get_principal(k5->ctx, k5->cc, &k5->me); if (code != 0) { code = krb5_parse_name(k5->ctx, u_info->name, &k5->me); if (code != 0) { g_printf("krb5_parse_name failed in k5_begin\n"); return 0; } } } } code = krb5_unparse_name(k5->ctx, k5->me, &k5->name); if (code != 0) { g_printf("krb5_unparse_name failed in k5_begin\n"); return 0; } opts->principal_name = k5->name; return 1; } /******************************************************************************/ static void k5_end(struct k5_data *k5) { if (k5->name) { krb5_free_unparsed_name(k5->ctx, k5->name); } if (k5->me) { krb5_free_principal(k5->ctx, k5->me); } if (k5->cc) { krb5_cc_close(k5->ctx, k5->cc); } if (k5->ctx) { krb5_free_context(k5->ctx); } g_memset(k5, 0, sizeof(struct k5_data)); } /******************************************************************************/ static krb5_error_code KRB5_CALLCONV kinit_prompter(krb5_context ctx, void *data, const char *name, const char *banner, int num_prompts, krb5_prompt prompts[]) { int i; krb5_prompt_type *types; krb5_error_code rc; struct user_info *u_info; u_info = (struct user_info *)data; rc = 0; types = krb5_get_prompt_types(ctx); for (i = 0; i < num_prompts; i++) { if (types[i] == KRB5_PROMPT_TYPE_PASSWORD || types[i] == KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN) { g_strncpy(prompts[i].reply->data, u_info->pass, 255); } } return rc; } /******************************************************************************/ /* returns boolean */ static int k5_kinit(struct k_opts *opts, struct k5_data *k5, struct user_info *u_info) { const char *doing; int notix = 1; krb5_keytab keytab = 0; krb5_creds my_creds; krb5_error_code code = 0; krb5_get_init_creds_opt options; krb5_address **addresses; krb5_get_init_creds_opt_init(&options); g_memset(&my_creds, 0, sizeof(my_creds)); /* From this point on, we can goto cleanup because my_creds is initialized. */ if (opts->lifetime) { krb5_get_init_creds_opt_set_tkt_life(&options, opts->lifetime); } if (opts->rlife) { krb5_get_init_creds_opt_set_renew_life(&options, opts->rlife); } if (opts->forwardable) { krb5_get_init_creds_opt_set_forwardable(&options, 1); } if (opts->not_forwardable) { krb5_get_init_creds_opt_set_forwardable(&options, 0); } if (opts->proxiable) { krb5_get_init_creds_opt_set_proxiable(&options, 1); } if (opts->not_proxiable) { krb5_get_init_creds_opt_set_proxiable(&options, 0); } if (opts->addresses) { addresses = NULL; code = krb5_os_localaddr(k5->ctx, &addresses); if (code != 0) { g_printf("krb5_os_localaddr failed in k5_kinit\n"); goto cleanup; } krb5_get_init_creds_opt_set_address_list(&options, addresses); } if (opts->no_addresses) { krb5_get_init_creds_opt_set_address_list(&options, NULL); } if ((opts->action == INIT_KT) && opts->keytab_name) { code = krb5_kt_resolve(k5->ctx, opts->keytab_name, &keytab); if (code != 0) { g_printf("krb5_kt_resolve failed in k5_kinit\n"); goto cleanup; } } switch (opts->action) { case INIT_PW: code = krb5_get_init_creds_password(k5->ctx, &my_creds, k5->me, 0, kinit_prompter, u_info, opts->starttime, opts->service_name, &options); break; case INIT_KT: code = krb5_get_init_creds_keytab(k5->ctx, &my_creds, k5->me, keytab, opts->starttime, opts->service_name, &options); break; case VALIDATE: code = krb5_get_validated_creds(k5->ctx, &my_creds, k5->me, k5->cc, opts->service_name); break; case RENEW: code = krb5_get_renewed_creds(k5->ctx, &my_creds, k5->me, k5->cc, opts->service_name); break; } if (code != 0) { doing = 0; switch (opts->action) { case INIT_PW: case INIT_KT: doing = "getting initial credentials"; break; case VALIDATE: doing = "validating credentials"; break; case RENEW: doing = "renewing credentials"; break; } if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY) { g_printf("sesman: Password incorrect while %s in k5_kinit\n", doing); } else { g_printf("sesman: error while %s in k5_kinit\n", doing); } goto cleanup; } if (!opts->lifetime) { /* We need to figure out what lifetime to use for Kerberos 4. */ opts->lifetime = my_creds.times.endtime - my_creds.times.authtime; } code = krb5_cc_initialize(k5->ctx, k5->cc, k5->me); if (code != 0) { g_printf("krb5_cc_initialize failed in k5_kinit\n"); goto cleanup; } code = krb5_cc_store_cred(k5->ctx, k5->cc, &my_creds); if (code != 0) { g_printf("krb5_cc_store_cred failed in k5_kinit\n"); goto cleanup; } notix = 0; cleanup: if (my_creds.client == k5->me) { my_creds.client = 0; } krb5_free_cred_contents(k5->ctx, &my_creds); if (keytab) { krb5_kt_close(k5->ctx, keytab); } return notix ? 0 : 1; } /******************************************************************************/ /* returns boolean */ int auth_userpass(const char *user, const char *pass, int *errorcode) { struct k_opts opts; struct k5_data k5; struct user_info u_info; int got_k5; int authed_k5; g_memset(&opts, 0, sizeof(opts)); opts.action = INIT_PW; g_memset(&k5, 0, sizeof(k5)); g_memset(&u_info, 0, sizeof(u_info)); u_info.name = user; u_info.pass = pass; authed_k5 = 0; got_k5 = k5_begin(&opts, &k5, &u_info); if (got_k5) { authed_k5 = k5_kinit(&opts, &k5, &u_info); k5_end(&k5); } return authed_k5; } /******************************************************************************/ /* returns error */ int auth_start_session(long in_val, int in_display) { return 0; } /******************************************************************************/ /* returns error */ int auth_stop_session(long in_val) { return 0; } /******************************************************************************/ int auth_end(long in_val) { return 0; } /******************************************************************************/ int auth_set_env(long in_val) { return 0; } xrdp-0.9.12/sesman/sesman.h000644 001751 001751 00000001750 13544635323 015440 0ustar00metameta000000 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 #include "arch.h" #include "parse.h" #include "os_calls.h" #include "log.h" #include "env.h" #include "auth.h" #include "config.h" #include "sig.h" #include "session.h" #include "access.h" #include "scp.h" #include "libscp.h" #endif xrdp-0.9.12/sesman/verify_user_bsd.c000644 001751 001751 00000004633 13544635323 017342 0ustar00metameta000000 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 "sesman.h" #define _XOPEN_SOURCE #include #include #include #include #include #include #include #ifndef SECS_PER_DAY #define SECS_PER_DAY (24L*3600L) #endif extern struct config_sesman* g_cfg; /* in sesman.c */ /******************************************************************************/ /* returns boolean */ long auth_userpass(const char *user, const char *pass, int *errorcode) { int ret = auth_userokay(user, NULL, "auth-xrdp", pass); return ret; } /******************************************************************************/ /* returns error */ int auth_start_session(long in_val, int in_display) { return 0; } /******************************************************************************/ int auth_end(long in_val) { return 0; } /******************************************************************************/ int auth_set_env(long in_val) { 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(long in_val) { 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) { return 0; } /** * * @return 1 if the account is disabled, 0 otherwise * */ static int auth_account_disabled(struct spwd* stp) { return 0; } xrdp-0.9.12/sesman/Doxyfile000644 001751 001751 00000020214 13544635323 015503 0ustar00metameta000000 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.9.12/sesman/Makefile.in000644 001751 001751 00000105051 13601646126 016042 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG 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_SOURCES_DIST = access.c access.h auth.h config.c \ config.h env.c env.h scp.c scp.h scp_v0.c scp_v0.h scp_v1.c \ scp_v1.h scp_v1_mng.c scp_v1_mng.h sesman.c sesman.h session.c \ session.h sig.c sig.h xauth.c xauth.h verify_user_pam.c \ verify_user_kerberos.c verify_user_pam_userpass.c \ verify_user_bsd.c verify_user.c @SESMAN_BSD_FALSE@@SESMAN_KERBEROS_FALSE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_FALSE@am__objects_1 = verify_user_pam.$(OBJEXT) @SESMAN_BSD_FALSE@@SESMAN_KERBEROS_TRUE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_FALSE@am__objects_1 = verify_user_kerberos.$(OBJEXT) @SESMAN_BSD_FALSE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_TRUE@am__objects_1 = verify_user_pam_userpass.$(OBJEXT) @SESMAN_BSD_TRUE@@SESMAN_NOPAM_FALSE@am__objects_1 = verify_user_bsd.$(OBJEXT) @SESMAN_NOPAM_TRUE@am__objects_1 = verify_user.$(OBJEXT) am_xrdp_sesman_OBJECTS = access.$(OBJEXT) config.$(OBJEXT) \ env.$(OBJEXT) scp.$(OBJEXT) scp_v0.$(OBJEXT) scp_v1.$(OBJEXT) \ scp_v1_mng.$(OBJEXT) sesman.$(OBJEXT) session.$(OBJEXT) \ sig.$(OBJEXT) xauth.$(OBJEXT) $(am__objects_1) xrdp_sesman_OBJECTS = $(am_xrdp_sesman_OBJECTS) am__DEPENDENCIES_1 = xrdp_sesman_DEPENDENCIES = $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libscp/libscp.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__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)/access.Po ./$(DEPDIR)/config.Po \ ./$(DEPDIR)/env.Po ./$(DEPDIR)/scp.Po ./$(DEPDIR)/scp_v0.Po \ ./$(DEPDIR)/scp_v1.Po ./$(DEPDIR)/scp_v1_mng.Po \ ./$(DEPDIR)/sesman.Po ./$(DEPDIR)/session.Po \ ./$(DEPDIR)/sig.Po ./$(DEPDIR)/verify_user.Po \ ./$(DEPDIR)/verify_user_bsd.Po \ ./$(DEPDIR)/verify_user_kerberos.Po \ ./$(DEPDIR)/verify_user_pam.Po \ ./$(DEPDIR)/verify_user_pam_userpass.Po ./$(DEPDIR)/xauth.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 = $(am__xrdp_sesman_SOURCES_DIST) 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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_SYSCONF_PATH=\"${sysconfdir}\" \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_SOCKET_PATH=\"${socketdir}\" -I$(top_srcdir)/common \ -I$(top_srcdir)/sesman/libscp $(am__append_1) @SESMAN_BSD_FALSE@@SESMAN_KERBEROS_FALSE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_FALSE@AUTH_C = verify_user_pam.c @SESMAN_BSD_FALSE@@SESMAN_KERBEROS_TRUE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_FALSE@AUTH_C = verify_user_kerberos.c @SESMAN_BSD_FALSE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_TRUE@AUTH_C = verify_user_pam_userpass.c @SESMAN_BSD_TRUE@@SESMAN_NOPAM_FALSE@AUTH_C = verify_user_bsd.c @SESMAN_NOPAM_TRUE@AUTH_C = verify_user.c @SESMAN_BSD_FALSE@@SESMAN_KERBEROS_FALSE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_FALSE@AUTH_LIB = -lpam @SESMAN_BSD_FALSE@@SESMAN_KERBEROS_TRUE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_FALSE@AUTH_LIB = -lkrb5 @SESMAN_BSD_FALSE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_TRUE@AUTH_LIB = -lpam -lpam_userpass @SESMAN_BSD_TRUE@@SESMAN_NOPAM_FALSE@AUTH_LIB = @SESMAN_NOPAM_TRUE@AUTH_LIB = -lcrypt xrdp_sesman_SOURCES = \ access.c \ access.h \ auth.h \ config.c \ config.h \ env.c \ env.h \ scp.c \ scp.h \ scp_v0.c \ scp_v0.h \ scp_v1.c \ scp_v1.h \ scp_v1_mng.c \ scp_v1_mng.h \ sesman.c \ sesman.h \ session.c \ session.h \ sig.c \ sig.h \ xauth.c \ xauth.h \ $(AUTH_C) xrdp_sesman_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libscp/libscp.la \ $(AUTH_LIB) \ -lpthread 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 = \ libscp \ 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)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list 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)/access.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.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)/scp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_v0.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_v1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_v1_mng.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.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify_user.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify_user_bsd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify_user_kerberos.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify_user_pam.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify_user_pam_userpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xauth.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/access.Po -rm -f ./$(DEPDIR)/config.Po -rm -f ./$(DEPDIR)/env.Po -rm -f ./$(DEPDIR)/scp.Po -rm -f ./$(DEPDIR)/scp_v0.Po -rm -f ./$(DEPDIR)/scp_v1.Po -rm -f ./$(DEPDIR)/scp_v1_mng.Po -rm -f ./$(DEPDIR)/sesman.Po -rm -f ./$(DEPDIR)/session.Po -rm -f ./$(DEPDIR)/sig.Po -rm -f ./$(DEPDIR)/verify_user.Po -rm -f ./$(DEPDIR)/verify_user_bsd.Po -rm -f ./$(DEPDIR)/verify_user_kerberos.Po -rm -f ./$(DEPDIR)/verify_user_pam.Po -rm -f ./$(DEPDIR)/verify_user_pam_userpass.Po -rm -f ./$(DEPDIR)/xauth.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)/access.Po -rm -f ./$(DEPDIR)/config.Po -rm -f ./$(DEPDIR)/env.Po -rm -f ./$(DEPDIR)/scp.Po -rm -f ./$(DEPDIR)/scp_v0.Po -rm -f ./$(DEPDIR)/scp_v1.Po -rm -f ./$(DEPDIR)/scp_v1_mng.Po -rm -f ./$(DEPDIR)/sesman.Po -rm -f ./$(DEPDIR)/session.Po -rm -f ./$(DEPDIR)/sig.Po -rm -f ./$(DEPDIR)/verify_user.Po -rm -f ./$(DEPDIR)/verify_user_bsd.Po -rm -f ./$(DEPDIR)/verify_user_kerberos.Po -rm -f ./$(DEPDIR)/verify_user_pam.Po -rm -f ./$(DEPDIR)/verify_user_pam_userpass.Po -rm -f ./$(DEPDIR)/xauth.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: xrdp-0.9.12/sesman/sig.h000644 001751 001751 00000002322 13544635323 014730 0ustar00metameta000000 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 Shutdown signal code * @param sig The received signal * */ void sig_sesman_shutdown(int sig); /** * * @brief SIGHUP handling code * @param sig The received signal * */ void sig_sesman_reload_cfg(int sig); /** * * @brief SIGCHLD handling code * @param sig The received signal * */ void sig_sesman_session_end(int sig); /** * * @brief signal handling thread * */ void* sig_handler_thread(void* arg); #endif xrdp-0.9.12/sesman/scp.c000644 001751 001751 00000006470 13544635323 014736 0ustar00metameta000000 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) common code * scp (sesman control protocol) common code * This code controls which version is being used and starts the * appropriate process * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "sesman.h" extern struct config_sesman *g_cfg; /* in sesman.c */ /******************************************************************************/ void * scp_process_start(void *sck) { struct SCP_CONNECTION scon; struct SCP_SESSION *sdata = NULL; scon.in_sck = (int)(tintptr)sck; LOG_DBG("started scp thread on socket %d", scon.in_sck); make_stream(scon.in_s); make_stream(scon.out_s); init_stream(scon.in_s, 8192); init_stream(scon.out_s, 8192); switch (scp_vXs_accept(&scon, &(sdata))) { case SCP_SERVER_STATE_OK: if (sdata->version == 0) { /* starts processing an scp v0 connection */ LOG_DBG("accept ok, go on with scp v0"); scp_v0_process(&scon, sdata); } else { LOG_DBG("accept ok, go on with scp v1"); /*LOG_DBG("user: %s\npass: %s",sdata->username, sdata->password);*/ scp_v1_process(&scon, sdata); } break; case SCP_SERVER_STATE_START_MANAGE: /* starting a management session */ log_message(LOG_LEVEL_WARNING, "starting a sesman management session..."); scp_v1_mng_process(&scon, sdata); break; case SCP_SERVER_STATE_VERSION_ERR: /* an unknown scp version was requested, so we shut down the */ /* connection (and log the fact) */ log_message(LOG_LEVEL_WARNING, "unknown protocol version specified. connection refused."); break; case SCP_SERVER_STATE_NETWORK_ERR: log_message(LOG_LEVEL_WARNING, "libscp network error."); break; case SCP_SERVER_STATE_SEQUENCE_ERR: log_message(LOG_LEVEL_WARNING, "libscp sequence error."); break; case SCP_SERVER_STATE_INTERNAL_ERR: /* internal error occurred (eg. malloc() error, ecc.) */ log_message(LOG_LEVEL_ERROR, "libscp internal error occurred."); break; default: log_message(LOG_LEVEL_ALWAYS, "unknown return from scp_vXs_accept()"); break; } free_stream(scon.in_s); free_stream(scon.out_s); if (sdata) { scp_session_destroy(sdata); } return 0; } xrdp-0.9.12/sesman/scp_v0.c000644 001751 001751 00000012475 13544635323 015345 0ustar00metameta000000 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_v0.c * @brief scp version 0 implementation * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "sesman.h" extern struct config_sesman *g_cfg; /* in sesman.c */ /******************************************************************************/ void scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { int display = 0; tbus data; struct session_item *s_item; int errorcode = 0; bool_t do_auth_end = 1; data = auth_userpass(s->username, s->password, &errorcode); if (s->type == SCP_GW_AUTHENTICATION) { /* this is just authentication in a gateway situation */ /* g_writeln("SCP_GW_AUTHENTICATION message received"); */ if (data) { if (1 == access_login_allowed(s->username)) { /* the user is member of the correct groups. */ scp_v0s_replyauthentication(c, errorcode); log_message(LOG_LEVEL_INFO, "Access permitted for user: %s", s->username); /* g_writeln("Connection allowed"); */ } else { scp_v0s_replyauthentication(c, 32 + 3); /* all first 32 are reserved for PAM errors */ log_message(LOG_LEVEL_INFO, "Username okey but group problem for " "user: %s", s->username); /* g_writeln("user password ok, but group problem"); */ } } else { /* g_writeln("username or password error"); */ log_message(LOG_LEVEL_INFO, "Username or password error for user: %s", s->username); scp_v0s_replyauthentication(c, errorcode); } } else if (data) { s_item = session_get_bydata(s->username, s->width, s->height, s->bpp, s->type, s->client_ip); if (s_item != 0) { display = s_item->display; g_memcpy(s->guid, s_item->guid, 16); if (0 != s->client_ip) { log_message( LOG_LEVEL_INFO, "++ reconnected session: username %s, " "display :%d.0, session_pid %d, ip %s", s->username, display, s_item->pid, s->client_ip); } else { log_message(LOG_LEVEL_INFO, "++ reconnected session: username %s, " "display :%d.0, session_pid %d", s->username, display, s_item->pid); } session_reconnect(display, s->username, data); } else { LOG_DBG("pre auth"); if (1 == access_login_allowed(s->username)) { tui8 guid[16]; g_random((char*)guid, 16); scp_session_set_guid(s, guid); if (0 != s->client_ip) { log_message(LOG_LEVEL_INFO, "++ created session (access granted): " "username %s, ip %s", s->username, s->client_ip); } else { log_message(LOG_LEVEL_INFO, "++ created session (access granted): " "username %s", s->username); } if (SCP_SESSION_TYPE_XVNC == s->type) { log_message( LOG_LEVEL_INFO, "starting Xvnc session..."); display = session_start(data, SESMAN_SESSION_TYPE_XVNC, c, s); } else if (SCP_SESSION_TYPE_XRDP == s->type) { log_message(LOG_LEVEL_INFO, "starting X11rdp session..."); display = session_start(data, SESMAN_SESSION_TYPE_XRDP, c, s); } else if (SCP_SESSION_TYPE_XORG == s->type) { /* type is SCP_SESSION_TYPE_XORG */ log_message(LOG_LEVEL_INFO, "starting Xorg session..."); display = session_start(data, SESMAN_SESSION_TYPE_XORG, c, s); } /* if the session started up ok, auth_end will be called on sig child */ do_auth_end = display == 0; } else { display = 0; } } if (display == 0) { scp_v0s_deny_connection(c); } else { scp_v0s_allow_connection(c, display, s->guid); } } else { scp_v0s_deny_connection(c); } if (do_auth_end) { auth_end(data); } } xrdp-0.9.12/sesman/access.h000644 001751 001751 00000002320 13544635323 015405 0ustar00metameta000000 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 access.h * @brief User access control definitions * @author Simone Fedele * */ #ifndef ACCESS_H #define ACCESS_H /** * * @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 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 char *user); #endif xrdp-0.9.12/sesman/Makefile.am000644 001751 001751 00000003244 13544635323 016035 0ustar00metameta000000 000000 EXTRA_DIST = \ Doxyfile AM_CPPFLAGS = \ -DXRDP_SYSCONF_PATH=\"${sysconfdir}\" \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_SOCKET_PATH=\"${socketdir}\" \ -I$(top_srcdir)/common \ -I$(top_srcdir)/sesman/libscp if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif if SESMAN_NOPAM AUTH_C = verify_user.c AUTH_LIB = -lcrypt else if SESMAN_BSD AUTH_C = verify_user_bsd.c AUTH_LIB = else if SESMAN_PAMUSERPASS AUTH_C = verify_user_pam_userpass.c AUTH_LIB = -lpam -lpam_userpass else if SESMAN_KERBEROS AUTH_C = verify_user_kerberos.c AUTH_LIB = -lkrb5 else AUTH_C = verify_user_pam.c AUTH_LIB = -lpam endif endif endif endif sbin_PROGRAMS = \ xrdp-sesman xrdp_sesman_SOURCES = \ access.c \ access.h \ auth.h \ config.c \ config.h \ env.c \ env.h \ scp.c \ scp.h \ scp_v0.c \ scp_v0.h \ scp_v1.c \ scp_v1.h \ scp_v1_mng.c \ scp_v1_mng.h \ sesman.c \ sesman.h \ session.c \ session.h \ sig.c \ sig.h \ xauth.c \ xauth.h \ $(AUTH_C) xrdp_sesman_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libscp/libscp.la \ $(AUTH_LIB) \ -lpthread 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 = \ libscp \ tools \ chansrv xrdp-0.9.12/sesman/scp_v1.c000644 001751 001751 00000017652 13544635323 015350 0ustar00metameta000000 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_v1.c * @brief scp version 1 implementation * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "sesman.h" //#include "libscp_types.h" #include "libscp.h" extern struct config_sesman *g_cfg; /* in sesman.c */ static void parseCommonStates(enum SCP_SERVER_STATES_E e, const char *f); /******************************************************************************/ void scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { long data; int display = 0; int retries; int current_try; enum SCP_SERVER_STATES_E e; struct SCP_DISCONNECTED_SESSION *slist; struct session_item *sitem; int scount; SCP_SID sid; bool_t do_auth_end = 1; retries = g_cfg->sec.login_retry; current_try = retries; data = auth_userpass(s->username, s->password,NULL); /*LOG_DBG("user: %s\npass: %s", s->username, s->password);*/ while ((!data) && ((retries == 0) || (current_try > 0))) { LOG_DBG("data %d - retry %d - currenttry %d - expr %d", data, retries, current_try, ((!data) && ((retries == 0) || (current_try > 0)))); e = scp_v1s_request_password(c, s, "Wrong username and/or password"); switch (e) { case SCP_SERVER_STATE_OK: /* all ok, we got new username and password */ data = auth_userpass(s->username, s->password,NULL); /* one try less */ if (current_try > 0) { current_try--; } break; default: /* we check the other errors */ parseCommonStates(e, "scp_v1s_list_sessions()"); return; //break; } } if (!data) { scp_v1s_deny_connection(c, "Login failed"); log_message( LOG_LEVEL_INFO, "Login failed for user %s. Connection terminated", s->username); return; } /* testing if login is allowed*/ if (0 == access_login_allowed(s->username)) { scp_v1s_deny_connection(c, "Access to Terminal Server not allowed."); log_message(LOG_LEVEL_INFO, "User %s not allowed on TS. Connection terminated", s->username); return; } //check if we need password change /* list disconnected sessions */ slist = session_get_byuser(s->username, &scount, SESMAN_SESSION_STATUS_DISCONNECTED); if (scount == 0) { /* no disconnected sessions - start a new one */ log_message(LOG_LEVEL_DEBUG, "No disconnected sessions for this user " "- we create a new one"); if (0 != s->client_ip) { log_message(LOG_LEVEL_INFO, "++ created session (access granted): username %s, ip %s", s->username, s->client_ip); } else { log_message(LOG_LEVEL_INFO, "++ created session (access granted): username %s", s->username); } if (SCP_SESSION_TYPE_XVNC == s->type) { log_message(LOG_LEVEL_INFO, "starting Xvnc session..."); display = session_start(data, SESMAN_SESSION_TYPE_XVNC, c, s); } else if (SCP_SESSION_TYPE_XRDP == s->type) { log_message(LOG_LEVEL_INFO, "starting X11rdp session..."); display = session_start(data, SESMAN_SESSION_TYPE_XRDP, c, s); } else if (SCP_SESSION_TYPE_XORG == s->type) { log_message(LOG_LEVEL_INFO, "starting Xorg session..."); display = session_start(data, SESMAN_SESSION_TYPE_XORG, c, s); } /* if the session started up ok, auth_end will be called on sig child */ do_auth_end = display == 0; e = scp_v1s_connect_new_session(c, display); switch (e) { case SCP_SERVER_STATE_OK: /* all ok, we got new username and password */ break; default: /* we check the other errors */ parseCommonStates(e, "scp_v1s_connect_new_session()"); break; } } else { /* one or more disconnected sessions - listing */ e = scp_v1s_list_sessions(c, scount, slist, &sid); switch (e) { /*case SCP_SERVER_STATE_FORCE_NEW:*/ /* we should check for MaxSessions */ case SCP_SERVER_STATE_SELECTION_CANCEL: log_message( LOG_LEVEL_INFO, "Connection cancelled after session listing"); break; case SCP_SERVER_STATE_OK: /* ok, reconnecting... */ sitem = session_get_bypid(sid); if (0 == sitem) { e = scp_v1s_connection_error(c, "Internal error"); log_message(LOG_LEVEL_INFO, "Cannot find session item on the chain"); } else { display = sitem->display; /*e=scp_v1s_reconnect_session(c, sitem, display);*/ e = scp_v1s_reconnect_session(c, display); if (0 != s->client_ip) { log_message(LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, session_pid %d, ip %s", s->username, display, sitem->pid, s->client_ip); } else { log_message(LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, session_pid %d", s->username, display, sitem->pid); } g_free(sitem); } break; default: /* we check the other errors */ parseCommonStates(e, "scp_v1s_list_sessions()"); break; } } /* resource management */ if ((e == SCP_SERVER_STATE_OK) && (s->rsr)) { /* here goes scp resource sharing code */ } /* cleanup */ if (do_auth_end) { auth_end(data); } g_free(slist); } static void parseCommonStates(enum SCP_SERVER_STATES_E e, const char *f) { switch (e) { case SCP_SERVER_STATE_VERSION_ERR: LOG_DBG("version error") case SCP_SERVER_STATE_SIZE_ERR: /* an unknown scp version was requested, so we shut down the */ /* connection (and log the fact) */ log_message(LOG_LEVEL_WARNING, "protocol violation. connection closed."); break; case SCP_SERVER_STATE_NETWORK_ERR: log_message(LOG_LEVEL_WARNING, "libscp network error."); break; case SCP_SERVER_STATE_SEQUENCE_ERR: log_message(LOG_LEVEL_WARNING, "libscp sequence error."); break; case SCP_SERVER_STATE_INTERNAL_ERR: /* internal error occurred (eg. malloc() error, ecc.) */ log_message(LOG_LEVEL_ERROR, "libscp internal error occurred."); break; default: /* dummy: scp_v1s_request_password won't generate any other */ /* error other than the ones before */ log_message(LOG_LEVEL_ALWAYS, "unknown return from %s", f); break; } } xrdp-0.9.12/sesman/config.h000644 001751 001751 00000023337 13544635323 015424 0ustar00metameta000000 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.h * @brief User authentication definitions * @author Simone Fedele @< simo [at] esseemme [dot] org @> * */ #ifndef CONFIG_H #define CONFIG_H #include "arch.h" #include "list.h" #include "log.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_MAX_SESSION "MaxSessions" #define SESMAN_CFG_AUTH_FILE_PATH "AuthFilePath" #define SESMAN_CFG_RECONNECT_SH "ReconnectScript" #define SESMAN_CFG_RDP_PARAMS "X11rdp" #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_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_POLICY_S "Policy" #define SESMAN_CFG_SESS_POLICY_DFLT_S "Default" #define SESMAN_CFG_SESS_POLICY_UBD_S "UBD" #define SESMAN_CFG_SESS_POLICY_UBI_S "UBI" #define SESMAN_CFG_SESS_POLICY_UBC_S "UBC" #define SESMAN_CFG_SESS_POLICY_UBDI_S "UBDI" #define SESMAN_CFG_SESS_POLICY_UBDC_S "UBDC" enum SESMAN_CFG_SESS_POLICY_BITS { SESMAN_CFG_SESS_POLICY_D = 0x01, SESMAN_CFG_SESS_POLICY_I = 0x02, SESMAN_CFG_SESS_POLICY_C = 0x04 }; enum SESMAN_CFG_SESS_POLICY { SESMAN_CFG_SESS_POLICY_DFLT = 0, SESMAN_CFG_SESS_POLICY_UBD = SESMAN_CFG_SESS_POLICY_D, SESMAN_CFG_SESS_POLICY_UBI = SESMAN_CFG_SESS_POLICY_I, SESMAN_CFG_SESS_POLICY_UBC = SESMAN_CFG_SESS_POLICY_C, SESMAN_CFG_SESS_POLICY_UBDI = SESMAN_CFG_SESS_POLICY_D | SESMAN_CFG_SESS_POLICY_I, SESMAN_CFG_SESS_POLICY_UBDC = SESMAN_CFG_SESS_POLICY_D | SESMAN_CFG_SESS_POLICY_C }; /** * * @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 */ int ts_users_enable; int ts_users; /** * @var ts_admins * @brief Terminal Server Administrators group */ int ts_admins_enable; int 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; }; /** * * @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 */ int x11_display_offset; /** * @var max_sessions * @brief maximum number of allowed sessions. 0 for unlimited */ 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 */ enum SESMAN_CFG_SESS_POLICY 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 listen_address * @brief Listening address */ char listen_address[32]; /** * @var listen_port * @brief Listening port */ char listen_port[16]; /** * @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[32]; /** * @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 rdp_params * @brief X11rdp additional parameter list */ struct list* rdp_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 cfg pointer to configuration object to be replaced * @return 0 on success, 1 on failure * */ int config_read(struct config_sesman* cfg); /** * * @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 * */ int config_read_globals(int file, struct config_sesman* cf, struct list* param_n, struct list* param_v); /** * * @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 * */ int config_read_security(int file, struct config_security* sc, struct list* param_n, struct list* param_v); /** * * @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 * */ int config_read_sessions(int file, struct config_sessions* ss, struct list* param_n, struct list* param_v); /** * * @brief Reads sesman [X11rdp] 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 * */ int config_read_rdp_params(int file, struct config_sesman* cs, struct list* param_n, struct list* param_v); /** * * @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 * */ int config_read_xorg_params(int file, struct config_sesman* cs, struct list* param_n, struct list* param_v); /** * * @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 * */ int config_read_vnc_params(int file, struct config_sesman* cs, struct list* param_n, struct list* param_v); int config_read_session_variables(int file, struct config_sesman *cs, struct list *param_n, struct list *param_v); /** * * @brief Dumps configuration * @param pointer to a config_sesman struct * */ void config_dump(struct config_sesman *config); void config_free(struct config_sesman *cs); #endif xrdp-0.9.12/sesman/env.h000644 001751 001751 00000002656 13544635323 014750 0ustar00metameta000000 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 username Username * @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(const char *username, char **passwd_file, int display, const struct list *env_names, const struct list *env_values); #endif xrdp-0.9.12/sesman/scp_v1_mng.c000644 001751 001751 00000010310 13544635323 016171 0ustar00metameta000000 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_v1_mng.c * @brief scp version 1 implementation - management * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "sesman.h" #include "libscp.h" extern struct config_sesman *g_cfg; /* in sesman.c */ static void parseCommonStates(enum SCP_SERVER_STATES_E e, const char *f); /******************************************************************************/ void scp_v1_mng_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { long data; enum SCP_SERVER_STATES_E e; struct SCP_DISCONNECTED_SESSION *slist = 0; int scount; int end = 0; data = auth_userpass(s->username, s->password,NULL); /*LOG_DBG("user: %s\npass: %s", s->username, s->password);*/ if (!data) { scp_v1s_mng_deny_connection(c, "Login failed"); log_message(LOG_LEVEL_INFO, "[MNG] Login failed for user %s. Connection terminated", s->username); auth_end(data); return; } /* testing if login is allowed */ if (0 == access_login_mng_allowed(s->username)) { scp_v1s_mng_deny_connection(c, "Access to Terminal Server not allowed."); log_message(LOG_LEVEL_INFO, "[MNG] User %s not allowed on TS. Connection terminated", s->username); auth_end(data); return; } e = scp_v1s_mng_allow_connection(c, s); end = 1; while (end) { switch (e) { case SCP_SERVER_STATE_MNG_ACTION: log_message(LOG_LEVEL_INFO, "Connection cancelled after session listing"); break; case SCP_SERVER_STATE_MNG_LISTREQ: /* list disconnected sessions */ slist = session_get_byuser(NULL, &scount, SESMAN_SESSION_STATUS_ALL); LOG_DBG("sessions on TS: %d (slist: %x)", scount, slist); if (0 == slist) { log_message(LOG_LEVEL_INFO, "No sessions on Terminal Server"); } e = scp_v1s_mng_list_sessions(c, s, scount, slist); g_free(slist); break; default: /* we check the other errors */ parseCommonStates(e, "scp_v1s_mng_list_sessions()"); end = 0; break; } } /* cleanup */ auth_end(data); } static void parseCommonStates(enum SCP_SERVER_STATES_E e, const char *f) { switch (e) { case SCP_SERVER_STATE_VERSION_ERR: LOG_DBG("version error") case SCP_SERVER_STATE_SIZE_ERR: /* an unknown scp version was requested, so we shut down the */ /* connection (and log the fact) */ log_message(LOG_LEVEL_WARNING, "protocol violation. connection closed."); break; case SCP_SERVER_STATE_NETWORK_ERR: log_message(LOG_LEVEL_WARNING, "libscp network error."); break; case SCP_SERVER_STATE_SEQUENCE_ERR: log_message(LOG_LEVEL_WARNING, "libscp sequence error."); break; case SCP_SERVER_STATE_INTERNAL_ERR: /* internal error occurred (eg. malloc() error, ecc.) */ log_message(LOG_LEVEL_ERROR, "libscp internal error occurred."); break; default: /* dummy: scp_v1s_request_password won't generate any other */ /* error other than the ones before */ log_message(LOG_LEVEL_ALWAYS, "unknown return from %s", f); break; } } xrdp-0.9.12/sesman/sig.c000644 001751 001751 00000012005 13544635323 014722 0ustar00metameta000000 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 #include "sesman.h" extern int g_sck; extern int g_pid; extern struct config_sesman *g_cfg; /* in sesman.c */ extern tbus g_term_event; /******************************************************************************/ void sig_sesman_shutdown(int sig) { char pid_file[256]; log_message(LOG_LEVEL_INFO, "shutting down sesman %d", 1); if (g_getpid() != g_pid) { LOG_DBG("g_getpid() [%d] differs from g_pid [%d]", (g_getpid()), g_pid); return; } LOG_DBG(" - getting signal %d pid %d", sig, g_getpid()); g_set_wait_obj(g_term_event); session_sigkill_all(); g_snprintf(pid_file, 255, "%s/xrdp-sesman.pid", XRDP_PID_PATH); g_file_delete(pid_file); } /******************************************************************************/ void sig_sesman_reload_cfg(int sig) { int error; struct config_sesman *cfg; char cfg_file[256]; log_message(LOG_LEVEL_WARNING, "receiving SIGHUP %d", 1); if (g_getpid() != g_pid) { LOG_DBG("g_getpid() [%d] differs from g_pid [%d]", g_getpid(), g_pid); return; } cfg = g_new0(struct config_sesman, 1); if (0 == cfg) { log_message(LOG_LEVEL_ERROR, "error creating new config: - keeping old cfg"); return; } if (config_read(cfg) != 0) { log_message(LOG_LEVEL_ERROR, "error reading config - keeping old cfg"); g_free(cfg); return; } /* stop logging subsystem */ log_end(); /* free old config data */ config_free(g_cfg); /* replace old config with newly read one */ g_cfg = cfg; g_snprintf(cfg_file, 255, "%s/sesman.ini", XRDP_CFG_PATH); /* start again logging subsystem */ error = log_start(cfg_file, "xrdp-sesman"); 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_message(LOG_LEVEL_INFO, "configuration reloaded, log subsystem restarted"); } /******************************************************************************/ void sig_sesman_session_end(int sig) { int pid; if (g_getpid() != g_pid) { return; } pid = g_waitchild(); if (pid > 0) { session_kill(pid); } } /******************************************************************************/ void * sig_handler_thread(void *arg) { int recv_signal; sigset_t sigmask; sigset_t oldmask; sigset_t waitmask; /* mask signals to be able to wait for them... */ sigfillset(&sigmask); /* it is a good idea not to block SIGILL SIGSEGV */ /* SIGFPE -- see sigaction(2) NOTES */ pthread_sigmask(SIG_BLOCK, &sigmask, &oldmask); /* building the signal wait mask... */ sigemptyset(&waitmask); sigaddset(&waitmask, SIGHUP); sigaddset(&waitmask, SIGCHLD); sigaddset(&waitmask, SIGTERM); sigaddset(&waitmask, SIGINT); // sigaddset(&waitmask, SIGFPE); // sigaddset(&waitmask, SIGILL); // sigaddset(&waitmask, SIGSEGV); do { LOG_DBG("calling sigwait()"); sigwait(&waitmask, &recv_signal); switch (recv_signal) { case SIGHUP: //reload cfg //we must stop & restart logging, or copy logging cfg!!!! LOG_DBG("sesman received SIGHUP"); //return 0; break; case SIGCHLD: /* a session died */ LOG_DBG("sesman received SIGCHLD"); sig_sesman_session_end(SIGCHLD); break; case SIGINT: /* we die */ LOG_DBG("sesman received SIGINT"); sig_sesman_shutdown(recv_signal); break; case SIGTERM: /* we die */ LOG_DBG("sesman received SIGTERM"); sig_sesman_shutdown(recv_signal); break; } } while (1); return 0; } xrdp-0.9.12/sesman/scp.h000644 001751 001751 00000002074 13544635323 014737 0ustar00metameta000000 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.h * @brief scp (sesman control protocol) common definitions * @author Simone Fedele * */ #ifndef SCP_H #define SCP_H #include "scp_v0.h" #include "scp_v1.h" #include "scp_v1_mng.h" /** * * @brief Starts a an scp protocol thread. * Starts a an scp protocol thread. * But does only version control.... * @param socket the connection socket * */ void* scp_process_start(void* sck); #endif xrdp-0.9.12/sesman/auth.h000644 001751 001751 00000003733 13544635323 015116 0ustar00metameta000000 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 auth.h * @brief User authentication definitions * @author Jay Sorg * */ #ifndef AUTH_H #define AUTH_H /** * * @brief Validates user's password * @param user user's login name * @param pass user's password * @return non-zero handle on success, 0 on failure * */ long auth_userpass(const char *user, const char *pass, int *errorcode); /** * * @brief FIXME * @param in_val * @param in_display * @return 0 on success, 1 on failure * */ int auth_start_session(long in_val, int in_display); /** * * @brief FIXME * @param in_val * @return 0 on success, 1 on failure * */ int auth_stop_session(long in_val); /** * * @brief FIXME * @param in_val * @return 0 on success, 1 on failure * */ int auth_end(long in_val); /** * * @brief FIXME * @param in_val * @return 0 on success, 1 on failure * */ int auth_set_env(long in_val); #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 FIXME * @param in_val * @return 0 on success, 1 on failure * */ int auth_check_pwd_chg(const char *user); /** * * @brief FIXME * @param in_val * @return 0 on success, 1 on failure * */ int auth_change_pwd(const char *user, const char *newpwd); #endif xrdp-0.9.12/sesman/libscp/000755 001751 001751 00000000000 13601646134 015246 5ustar00metameta000000 000000 xrdp-0.9.12/sesman/sesman.c000644 001751 001751 00000031037 13601643631 015427 0ustar00metameta000000 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 "sesman.h" int g_sck; int g_pid; unsigned char g_fixedkey[8] = { 23, 82, 107, 6, 35, 78, 88, 7 }; struct config_sesman *g_cfg; /* defined in config.h */ tintptr g_term_event = 0; /******************************************************************************/ int sesman_listen_test(struct config_sesman *cfg) { int error; int sck; int rv = 0; sck = g_tcp_socket(); if (sck < 0) { return 1; } log_message(LOG_LEVEL_DEBUG, "Testing if xrdp-sesman can listen on %s port %s.", cfg->listen_address, cfg->listen_port); g_tcp_set_non_blocking(sck); error = scp_tcp_bind(sck, cfg->listen_address, cfg->listen_port); if (error == 0) { /* try to listen */ error = g_tcp_listen(sck); if (error == 0) { /* if listen succeeded, stop listen immediately */ g_sck_close(sck); } else { rv = 1; } } else { rv = 1; } return rv; } /******************************************************************************/ /** * * @brief Starts sesman main loop * */ int sesman_main_loop(void) { int in_sck; int error; int robjs_count; int cont; int rv = 0; tbus sck_obj; tbus robjs[8]; g_sck = g_tcp_socket(); if (g_sck < 0) { log_message(LOG_LEVEL_ERROR, "error opening socket, g_tcp_socket() failed..."); return 1; } g_tcp_set_non_blocking(g_sck); error = scp_tcp_bind(g_sck, g_cfg->listen_address, g_cfg->listen_port); if (error == 0) { error = g_tcp_listen(g_sck); if (error == 0) { log_message(LOG_LEVEL_INFO, "listening to port %s on %s", g_cfg->listen_port, g_cfg->listen_address); sck_obj = g_create_wait_obj_from_socket(g_sck, 0); cont = 1; while (cont) { /* build the wait obj list */ robjs_count = 0; robjs[robjs_count++] = sck_obj; robjs[robjs_count++] = g_term_event; /* wait */ if (g_obj_wait(robjs, robjs_count, 0, 0, -1) != 0) { /* error, should not get here */ g_sleep(100); } if (g_is_wait_obj_set(g_term_event)) /* term */ { break; } if (g_is_wait_obj_set(sck_obj)) /* incoming connection */ { in_sck = g_tcp_accept(g_sck); if ((in_sck == -1) && g_tcp_last_error_would_block(g_sck)) { /* should not get here */ g_sleep(100); } else if (in_sck == -1) { /* error, should not get here */ break; } else { /* we've got a connection, so we pass it to scp code */ LOG_DBG("new connection"); scp_process_start((void*)(tintptr)in_sck); g_sck_close(in_sck); } } } g_delete_wait_obj_from_socket(sck_obj); } else { log_message(LOG_LEVEL_ERROR, "listen error %d (%s)", g_get_errno(), g_get_strerror()); rv = 1; } } else { log_message(LOG_LEVEL_ERROR, "bind error on " "port '%s': %d (%s)", g_cfg->listen_port, g_get_errno(), g_get_strerror()); rv = 1; } g_tcp_close(g_sck); return rv; } /******************************************************************************/ void print_usage(int retcode) { g_printf("xrdp-sesman - xrdp session manager\n\n"); g_printf("Usage: xrdp-sesman [options]\n"); g_printf(" -n, --nodaemon run as foreground process\n"); g_printf(" -k, --kill kill running xrdp-sesman\n"); g_printf(" -h, --help show this help\n"); g_deinit(); g_exit(retcode); } /******************************************************************************/ int main(int argc, char **argv) { int fd; enum logReturns log_error; int error; int daemon = 1; int pid; char pid_s[32]; char text[256]; char pid_file[256]; char cfg_file[256]; g_init("xrdp-sesman"); g_snprintf(pid_file, 255, "%s/xrdp-sesman.pid", XRDP_PID_PATH); if (1 == argc) { /* start in daemon mode if no cli options */ daemon = 1; } else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--nodaemon")) || (0 == g_strcasecmp(argv[1], "-nodaemon")) || (0 == g_strcasecmp(argv[1], "-n")) || (0 == g_strcasecmp(argv[1], "-ns")))) { /* starts sesman not daemonized */ g_printf("starting sesman in foreground...\n"); daemon = 0; } else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--help")) || (0 == g_strcasecmp(argv[1], "-help")) || (0 == g_strcasecmp(argv[1], "-h")))) { print_usage(0); } else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--kill")) || (0 == g_strcasecmp(argv[1], "-kill")) || (0 == g_strcasecmp(argv[1], "-k")))) { /* killing running sesman */ /* 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); g_deinit(); g_exit(1); } fd = g_file_open(pid_file); if (-1 == fd) { g_printf("error opening pid file[%s]: %s\n", pid_file, g_get_strerror()); return 1; } g_memset(pid_s, 0, sizeof(pid_s)); error = g_file_read(fd, pid_s, 31); if (-1 == error) { g_printf("error reading pid file: %s\n", g_get_strerror()); g_file_close(fd); g_deinit(); g_exit(error); } g_file_close(fd); pid = g_atoi(pid_s); error = g_sigterm(pid); if (0 != error) { g_printf("error killing sesman: %s\n", g_get_strerror()); } else { g_file_delete(pid_file); } g_deinit(); g_exit(error); } else { /* there's something strange on the command line */ g_printf("Error: invalid command line arguments\n\n"); print_usage(1); } 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); } /* reading config */ g_cfg = g_new0(struct config_sesman, 1); if (0 == g_cfg) { g_printf("error creating config: quitting.\n"); g_deinit(); g_exit(1); } //g_cfg->log.fd = -1; /* don't use logging before reading its config */ if (0 != config_read(g_cfg)) { g_printf("error reading config: %s\nquitting.\n", g_get_strerror()); g_deinit(); g_exit(1); } /* not to spit on the console, show config summary only when running in foreground */ if (!daemon) { config_dump(g_cfg); } g_snprintf(cfg_file, 255, "%s/sesman.ini", XRDP_CFG_PATH); /* starting logging subsystem */ log_error = log_start(cfg_file, "xrdp-sesman"); 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: g_writeln("error"); break; } g_deinit(); g_exit(1); } log_message(LOG_LEVEL_TRACE, "config loaded in %s at %s:%d", __func__, __FILE__, __LINE__); log_message(LOG_LEVEL_TRACE, " listen_address = %s", g_cfg->listen_address); log_message(LOG_LEVEL_TRACE, " listen_port = %s", g_cfg->listen_port); log_message(LOG_LEVEL_TRACE, " enable_user_wm = %d", g_cfg->enable_user_wm); log_message(LOG_LEVEL_TRACE, " default_wm = %s", g_cfg->default_wm); log_message(LOG_LEVEL_TRACE, " user_wm = %s", g_cfg->user_wm); log_message(LOG_LEVEL_TRACE, " reconnect_sh = %s", g_cfg->reconnect_sh); log_message(LOG_LEVEL_TRACE, " auth_file_path = %s", g_cfg->auth_file_path); 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("/dev/null") < 0) { } if (g_file_open("/dev/null") < 0) { } if (g_file_open("/dev/null") < 0) { } } /* libscp initialization */ scp_init(); if (daemon) { /* start of daemonizing code */ if (sesman_listen_test(g_cfg) != 0) { log_message(LOG_LEVEL_ERROR, "Failed to start xrdp-sesman daemon, " "possibly address already in use."); g_deinit(); g_exit(1); } if (0 != g_fork()) { g_deinit(); g_exit(0); } } /* signal handling */ g_pid = g_getpid(); /* old style signal handling is now managed synchronously by a * separate thread. uncomment this block if you need old style * signal handling and comment out thread_sighandler_start() * going back to old style for the time being * problem with the sigaddset functions in sig.c - jts */ #if 1 g_signal_hang_up(sig_sesman_reload_cfg); /* SIGHUP */ g_signal_user_interrupt(sig_sesman_shutdown); /* SIGINT */ g_signal_terminate(sig_sesman_shutdown); /* SIGTERM */ g_signal_child_stop(sig_sesman_session_end); /* SIGCHLD */ #endif #if 0 thread_sighandler_start(); #endif if (daemon) { /* writing pid file */ fd = g_file_open(pid_file); if (-1 == fd) { log_message(LOG_LEVEL_ERROR, "error opening pid file[%s]: %s", pid_file, g_get_strerror()); log_end(); 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_message(LOG_LEVEL_INFO, "starting xrdp-sesman with pid %d", g_pid); /* make sure the socket directory exists */ g_mk_socket_path("xrdp-sesman"); /* make sure the /tmp/.X11-unix directory exists */ if (!g_directory_exist("/tmp/.X11-unix")) { if (!g_create_dir("/tmp/.X11-unix")) { log_message(LOG_LEVEL_ERROR, "sesman.c: error creating dir /tmp/.X11-unix"); } g_chmod_hex("/tmp/.X11-unix", 0x1777); } g_snprintf(text, 255, "xrdp_sesman_%8.8x_main_term", g_pid); g_term_event = g_create_wait_obj(text); error = sesman_main_loop(); /* clean up PID file on exit */ if (daemon) { g_file_delete(pid_file); } g_delete_wait_obj(g_term_event); if (!daemon) { log_end(); } g_deinit(); g_exit(error); return 0; } xrdp-0.9.12/sesman/xauth.h000644 001751 001751 00000002203 13544635323 015275 0ustar00metameta000000 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.9.12/sesman/session.c000644 001751 001751 00000113025 13544635323 015627 0ustar00metameta000000 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 #ifdef HAVE_SYS_PRCTL_H #include #endif #include "sesman.h" #include "libscp_types.h" #include "xauth.h" #include "xrdp_sockets.h" #ifndef PR_SET_NO_NEW_PRIVS #define PR_SET_NO_NEW_PRIVS 38 #endif extern unsigned char g_fixedkey[8]; extern struct config_sesman *g_cfg; /* in sesman.c */ extern int g_sck; /* in sesman.c */ struct session_chain *g_sessions; int g_session_count; extern tbus g_term_event; /* in sesman.c */ /** * 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) { g_writeln("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 ; } /******************************************************************************/ struct session_item * session_get_bydata(const char *name, int width, int height, int bpp, int type, const char *client_ip) { struct session_chain *tmp; enum SESMAN_CFG_SESS_POLICY policy = g_cfg->sess.policy; tmp = g_sessions; /* convert from SCP_SESSION_TYPE namespace to SESMAN_SESSION_TYPE namespace */ switch (type) { case SCP_SESSION_TYPE_XVNC: /* 0 */ type = SESMAN_SESSION_TYPE_XVNC; /* 2 */ /* Xvnc cannot resize */ policy = (enum SESMAN_CFG_SESS_POLICY) (policy | SESMAN_CFG_SESS_POLICY_D); break; case SCP_SESSION_TYPE_XRDP: /* 1 */ type = SESMAN_SESSION_TYPE_XRDP; /* 1 */ break; case SCP_SESSION_TYPE_XORG: type = SESMAN_SESSION_TYPE_XORG; break; default: return 0; } #if 0 log_message(LOG_LEVEL_INFO, "session_get_bydata: search policy %d U %s W %d H %d bpp %d T %d IP %s", policy, name, width, height, bpp, type, client_ip); #endif while (tmp != 0) { #if 0 log_message(LOG_LEVEL_INFO, "session_get_bydata: try %p U %s W %d H %d bpp %d T %d IP %s", tmp->item, tmp->item->name, tmp->item->width, tmp->item->height, tmp->item->bpp, tmp->item->type, tmp->item->client_ip); #endif if (g_strncmp(name, tmp->item->name, 255) == 0 && (!(policy & SESMAN_CFG_SESS_POLICY_D) || (tmp->item->width == width && tmp->item->height == height)) && (!(policy & SESMAN_CFG_SESS_POLICY_I) || (g_strncmp_d(client_ip, tmp->item->client_ip, ':', 255) == 0)) && (!(policy & SESMAN_CFG_SESS_POLICY_C) || (g_strncmp(client_ip, tmp->item->client_ip, 255) == 0)) && tmp->item->bpp == bpp && tmp->item->type == type) { return tmp->item; } tmp = tmp->next; } return 0; } /******************************************************************************/ /** * * @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) { g_sprintf(text, "/tmp/.X%d-lock", display); x_running = g_file_exist(text); } if (!x_running) /* check 59xx */ { 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 */ { 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 */ { 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) { g_sprintf(text, XRDP_CHANSRV_STR, display); x_running = g_file_exist(text); } if (!x_running) { g_sprintf(text, CHANSRV_PORT_OUT_STR, display); x_running = g_file_exist(text); } if (!x_running) { g_sprintf(text, CHANSRV_PORT_IN_STR, display); x_running = g_file_exist(text); } if (!x_running) { g_sprintf(text, CHANSRV_API_STR, display); x_running = g_file_exist(text); } if (!x_running) { g_sprintf(text, XRDP_X11RDP_STR, display); x_running = g_file_exist(text); } return x_running; } /******************************************************************************/ /** * * @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(int display) { char text[256]; int x_running; g_sprintf(text, "/tmp/.X11-unix/X%d", display); x_running = g_file_exist(text); if (!x_running) { g_sprintf(text, "/tmp/.X%d-lock", display); x_running = g_file_exist(text); } return x_running; } /******************************************************************************/ /* called with the main thread returns boolean */ static int session_is_display_in_chain(int display) { struct session_chain *chain; struct session_item *item; chain = g_sessions; while (chain != 0) { item = chain->item; if (item->display == display) { return 1; } chain = chain->next; } return 0; } /******************************************************************************/ /* called with the main thread */ static int session_get_avail_display_from_chain(void) { int display; display = g_cfg->sess.x11_display_offset; while ((display - g_cfg->sess.x11_display_offset) <= g_cfg->sess.max_sessions) { if (!session_is_display_in_chain(display)) { if (!x_server_running_check_ports(display)) { return display; } } display++; } log_message(LOG_LEVEL_ERROR, "X server -- no display in range is available"); return 0; } /******************************************************************************/ static int wait_for_xserver(int display) { int i; /* give X a bit to start */ /* wait up to 10 secs for x server to start */ i = 0; while (!x_server_running(display)) { i++; if (i > 40) { log_message(LOG_LEVEL_ERROR, "X server for display %d startup timeout", display); break; } g_sleep(250); } return 0; } /******************************************************************************/ static int session_start_chansrv(char *username, int display) { struct list *chansrv_params; char exe_path[262]; int chansrv_pid; chansrv_pid = g_fork(); if (chansrv_pid == 0) { chansrv_params = list_create(); chansrv_params->auto_free = 1; /* building parameters */ g_snprintf(exe_path, sizeof(exe_path), "%s/xrdp-chansrv", XRDP_SBIN_PATH); list_add_item(chansrv_params, (intptr_t) g_strdup(exe_path)); list_add_item(chansrv_params, 0); /* mandatory */ env_set_user(username, 0, display, g_cfg->env_names, g_cfg->env_values); if (g_cfg->sec.restrict_outbound_clipboard == 1) { g_setenv("CHANSRV_RESTRICT_OUTBOUND_CLIPBOARD", "1", 1); } /* executing chansrv */ g_execvp(exe_path, (char **) (chansrv_params->items)); /* should not get here */ log_message(LOG_LEVEL_ALWAYS, "error starting chansrv " "- user %s - pid %d", username, g_getpid()); list_delete(chansrv_params); g_exit(1); } return chansrv_pid; } /******************************************************************************/ /* called with the main thread */ static int session_start_fork(tbus data, tui8 type, struct SCP_CONNECTION *c, struct SCP_SESSION *s) { int display = 0; int pid = 0; int i = 0; char geometry[32]; char depth[32]; char screen[32]; /* display number */ char text[256]; char execvpparams[2048]; char *xserver; /* absolute/relative path to Xorg/X11rdp/Xvnc */ char *passwd_file; char **pp1 = (char **)NULL; struct session_chain *temp = (struct session_chain *)NULL; struct list *xserver_params = (struct list *)NULL; struct tm stime; time_t ltime; char authfile[256]; /* The filename for storing xauth informations */ int chansrv_pid; int display_pid; int window_manager_pid; /* initialize (zero out) local variables: */ g_memset(<ime, 0, sizeof(time_t)); g_memset(&stime, 0, sizeof(struct tm)); g_memset(geometry, 0, sizeof(char) * 32); g_memset(depth, 0, sizeof(char) * 32); g_memset(screen, 0, sizeof(char) * 32); g_memset(text, 0, sizeof(char) * 256); passwd_file = 0; /* check to limit concurrent sessions */ if (g_session_count >= g_cfg->sess.max_sessions) { log_message(LOG_LEVEL_INFO, "max concurrent session limit " "exceeded. login for user %s denied", s->username); return 0; } temp = (struct session_chain *)g_malloc(sizeof(struct session_chain), 0); if (temp == 0) { log_message(LOG_LEVEL_ERROR, "cannot create new chain " "element - user %s", s->username); return 0; } temp->item = (struct session_item *)g_malloc(sizeof(struct session_item), 0); if (temp->item == 0) { g_free(temp); log_message(LOG_LEVEL_ERROR, "cannot create new session " "item - user %s", s->username); return 0; } display = session_get_avail_display_from_chain(); if (display == 0) { g_free(temp->item); g_free(temp); return 0; } pid = g_fork(); /* parent is fork from tcp accept, child forks X and wm, then becomes scp */ if (pid == -1) { } else if (pid == 0) { log_message(LOG_LEVEL_INFO, "calling auth_start_session from pid %d", g_getpid()); auth_start_session(data, display); g_delete_wait_obj(g_term_event); g_tcp_close(g_sck); g_tcp_close(c->in_sck); g_sprintf(geometry, "%dx%d", s->width, s->height); g_sprintf(depth, "%d", s->bpp); g_sprintf(screen, ":%d", display); #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* * FreeBSD bug * ports/157282: effective login name is not set by xrdp-sesman * http://www.freebsd.org/cgi/query-pr.cgi?pr=157282 * * from: * $OpenBSD: session.c,v 1.252 2010/03/07 11:57:13 dtucker Exp $ * with some ideas about BSD process grouping to xrdp */ pid_t bsdsespid = g_fork(); if (bsdsespid == -1) { } else if (bsdsespid == 0) /* BSD session leader */ { /** * Create a new session and process group since the 4.4BSD * setlogin() affects the entire process group */ if (g_setsid() < 0) { log_message(LOG_LEVEL_ERROR, "setsid failed - pid %d", g_getpid()); } if (g_setlogin(s->username) < 0) { log_message(LOG_LEVEL_ERROR, "setlogin failed for user %s - pid %d", s->username, g_getpid()); } } g_waitpid(bsdsespid); if (bsdsespid > 0) { g_exit(0); /* * intermediate sesman should exit here after WM exits. * do not execure the following codes. */ } #endif window_manager_pid = g_fork(); /* parent becomes X, child forks wm, and waits, todo */ if (window_manager_pid == -1) { } else if (window_manager_pid == 0) { wait_for_xserver(display); env_set_user(s->username, 0, display, g_cfg->env_names, g_cfg->env_values); if (x_server_running(display)) { auth_set_env(data); if (s->directory != 0) { if (s->directory[0] != 0) { g_set_current_dir(s->directory); } } if (s->program != 0) { if (s->program[0] != 0) { g_execlp3(s->program, s->program, 0); log_message(LOG_LEVEL_ALWAYS, "error starting program %s for user %s - pid %d", s->program, s->username, g_getpid()); } } /* try to execute user window manager if enabled */ if (g_cfg->enable_user_wm) { g_sprintf(text, "%s/%s", g_getenv("HOME"), g_cfg->user_wm); if (g_file_exist(text)) { g_execlp3(text, g_cfg->user_wm, 0); log_message(LOG_LEVEL_ALWAYS, "error starting user " "wm for user %s - pid %d", s->username, g_getpid()); /* logging parameters */ log_message(LOG_LEVEL_DEBUG, "errno: %d, " "description: %s", g_get_errno(), g_get_strerror()); log_message(LOG_LEVEL_DEBUG, "execlp3 parameter " "list:"); log_message(LOG_LEVEL_DEBUG, " argv[0] = %s", text); log_message(LOG_LEVEL_DEBUG, " argv[1] = %s", g_cfg->user_wm); } } /* if we're here something happened to g_execlp3 so we try running the default window manager */ g_execlp3(g_cfg->default_wm, g_cfg->default_wm, 0); log_message(LOG_LEVEL_ALWAYS, "error starting default " "wm for user %s - pid %d", s->username, g_getpid()); /* logging parameters */ log_message(LOG_LEVEL_DEBUG, "errno: %d, description: " "%s", g_get_errno(), g_get_strerror()); log_message(LOG_LEVEL_DEBUG, "execlp3 parameter list:"); log_message(LOG_LEVEL_DEBUG, " argv[0] = %s", g_cfg->default_wm); log_message(LOG_LEVEL_DEBUG, " argv[1] = %s", g_cfg->default_wm); /* still a problem starting window manager just start xterm */ g_execlp3("xterm", "xterm", 0); /* should not get here */ log_message(LOG_LEVEL_ALWAYS, "error starting xterm " "for user %s - pid %d", s->username, g_getpid()); /* logging parameters */ log_message(LOG_LEVEL_DEBUG, "errno: %d, description: " "%s", g_get_errno(), g_get_strerror()); } else { log_message(LOG_LEVEL_ERROR, "another Xserver might " "already be active on display %d - see log", display); } log_message(LOG_LEVEL_DEBUG, "aborting connection..."); g_exit(0); } else { display_pid = g_fork(); /* parent becomes scp, child becomes X */ if (display_pid == -1) { } else if (display_pid == 0) /* child */ { if (type == SESMAN_SESSION_TYPE_XVNC) { env_set_user(s->username, &passwd_file, display, g_cfg->env_names, g_cfg->env_values); } else { env_set_user(s->username, 0, display, g_cfg->env_names, g_cfg->env_values); } g_snprintf(text, 255, "%d", g_cfg->sess.max_idle_time); g_setenv("XRDP_SESMAN_MAX_IDLE_TIME", text, 1); g_snprintf(text, 255, "%d", g_cfg->sess.max_disc_time); g_setenv("XRDP_SESMAN_MAX_DISC_TIME", text, 1); g_snprintf(text, 255, "%d", g_cfg->sess.kill_disconnected); g_setenv("XRDP_SESMAN_KILL_DISCONNECTED", text, 1); g_setenv("XRDP_SOCKET_PATH", XRDP_SOCKET_PATH, 1); /* prepare the Xauthority stuff */ if (g_getenv("XAUTHORITY") != NULL) { g_snprintf(authfile, 255, "%s", g_getenv("XAUTHORITY")); } else { g_snprintf(authfile, 255, "%s", ".Xauthority"); } /* Add the entry in XAUTHORITY file or exit if error */ if (add_xauth_cookie(display, authfile) != 0) { g_exit(1); } if (type == SESMAN_SESSION_TYPE_XORG) { #ifdef HAVE_SYS_PRCTL_H /* * 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. * PR_SET_NO_NEW_PRIVS requires Linux kernel 3.5 and newer. */ if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0) { log_message(LOG_LEVEL_WARNING, "Failed to disable setuid on X server: %s", g_get_strerror()); } #endif xserver_params = list_create(); xserver_params->auto_free = 1; /* get path of Xorg from config */ xserver = g_strdup((const char *)list_get_item(g_cfg->xorg_params, 0)); /* these are the must have parameters */ list_add_item(xserver_params, (tintptr) g_strdup(xserver)); list_add_item(xserver_params, (tintptr) g_strdup(screen)); list_add_item(xserver_params, (tintptr) g_strdup("-auth")); list_add_item(xserver_params, (tintptr) g_strdup(authfile)); /* additional parameters from sesman.ini file */ list_append_list_strdup(g_cfg->xorg_params, xserver_params, 1); /* make sure it ends with a zero */ list_add_item(xserver_params, 0); pp1 = (char **) xserver_params->items; log_message(LOG_LEVEL_INFO, "%s", dumpItemsToString(xserver_params, execvpparams, 2048)); /* some args are passed via env vars */ g_sprintf(geometry, "%d", s->width); g_setenv("XRDP_START_WIDTH", geometry, 1); g_sprintf(geometry, "%d", s->height); g_setenv("XRDP_START_HEIGHT", geometry, 1); /* fire up Xorg */ g_execvp(xserver, pp1); } else if (type == SESMAN_SESSION_TYPE_XVNC) { char guid_str[64]; g_bytes_to_hexstr(s->guid, 16, guid_str, 64); env_check_password_file(passwd_file, guid_str); xserver_params = list_create(); xserver_params->auto_free = 1; /* get path of Xvnc from config */ xserver = g_strdup((const char *)list_get_item(g_cfg->vnc_params, 0)); /* these are the must have parameters */ list_add_item(xserver_params, (tintptr)g_strdup(xserver)); list_add_item(xserver_params, (tintptr)g_strdup(screen)); list_add_item(xserver_params, (tintptr)g_strdup("-auth")); list_add_item(xserver_params, (tintptr)g_strdup(authfile)); list_add_item(xserver_params, (tintptr)g_strdup("-geometry")); list_add_item(xserver_params, (tintptr)g_strdup(geometry)); list_add_item(xserver_params, (tintptr)g_strdup("-depth")); list_add_item(xserver_params, (tintptr)g_strdup(depth)); list_add_item(xserver_params, (tintptr)g_strdup("-rfbauth")); list_add_item(xserver_params, (tintptr)g_strdup(passwd_file)); g_free(passwd_file); /* additional parameters from sesman.ini file */ //config_read_xserver_params(SESMAN_SESSION_TYPE_XVNC, // xserver_params); list_append_list_strdup(g_cfg->vnc_params, xserver_params, 1); /* make sure it ends with a zero */ list_add_item(xserver_params, 0); pp1 = (char **)xserver_params->items; log_message(LOG_LEVEL_INFO, "%s", dumpItemsToString(xserver_params, execvpparams, 2048)); g_execvp(xserver, pp1); } else if (type == SESMAN_SESSION_TYPE_XRDP) { xserver_params = list_create(); xserver_params->auto_free = 1; /* get path of X11rdp from config */ xserver = g_strdup((const char *)list_get_item(g_cfg->rdp_params, 0)); /* these are the must have parameters */ list_add_item(xserver_params, (tintptr)g_strdup(xserver)); list_add_item(xserver_params, (tintptr)g_strdup(screen)); list_add_item(xserver_params, (tintptr)g_strdup("-auth")); list_add_item(xserver_params, (tintptr)g_strdup(authfile)); list_add_item(xserver_params, (tintptr)g_strdup("-geometry")); list_add_item(xserver_params, (tintptr)g_strdup(geometry)); list_add_item(xserver_params, (tintptr)g_strdup("-depth")); list_add_item(xserver_params, (tintptr)g_strdup(depth)); /* additional parameters from sesman.ini file */ //config_read_xserver_params(SESMAN_SESSION_TYPE_XRDP, // xserver_params); list_append_list_strdup(g_cfg->rdp_params, xserver_params, 1); /* make sure it ends with a zero */ list_add_item(xserver_params, 0); pp1 = (char **)xserver_params->items; log_message(LOG_LEVEL_INFO, "%s", dumpItemsToString(xserver_params, execvpparams, 2048)); g_execvp(xserver, pp1); } else { log_message(LOG_LEVEL_ALWAYS, "bad session type - " "user %s - pid %d", s->username, g_getpid()); g_exit(1); } /* should not get here */ log_message(LOG_LEVEL_ALWAYS, "error starting X server " "- user %s - pid %d", s->username, g_getpid()); /* logging parameters */ log_message(LOG_LEVEL_DEBUG, "errno: %d, description: " "%s", g_get_errno(), g_get_strerror()); log_message(LOG_LEVEL_DEBUG, "execve parameter list size: " "%d", (xserver_params)->count); for (i = 0; i < (xserver_params->count); i++) { log_message(LOG_LEVEL_DEBUG, " argv[%d] = %s", i, (char *)list_get_item(xserver_params, i)); } list_delete(xserver_params); g_exit(1); } else { wait_for_xserver(display); chansrv_pid = session_start_chansrv(s->username, display); log_message(LOG_LEVEL_ALWAYS, "waiting for window manager " "(pid %d) to exit", window_manager_pid); g_waitpid(window_manager_pid); log_message(LOG_LEVEL_ALWAYS, "window manager (pid %d) did " "exit, cleaning up session", window_manager_pid); log_message(LOG_LEVEL_INFO, "calling auth_stop_session and " "auth_end from pid %d", g_getpid()); auth_stop_session(data); auth_end(data); g_sigterm(display_pid); g_sigterm(chansrv_pid); cleanup_sockets(display); g_deinit(); g_exit(0); } } } else { temp->item->pid = pid; temp->item->display = display; temp->item->width = s->width; temp->item->height = s->height; temp->item->bpp = s->bpp; temp->item->data = data; g_strncpy(temp->item->client_ip, s->client_ip, 255); /* store client ip data */ g_strncpy(temp->item->name, s->username, 255); g_memcpy(temp->item->guid, s->guid, 16); ltime = g_time1(); localtime_r(<ime, &stime); temp->item->connect_time.year = (tui16)(stime.tm_year + 1900); temp->item->connect_time.month = (tui8)(stime.tm_mon + 1); temp->item->connect_time.day = (tui8)stime.tm_mday; temp->item->connect_time.hour = (tui8)stime.tm_hour; temp->item->connect_time.minute = (tui8)stime.tm_min; zero_time(&(temp->item->disconnect_time)); zero_time(&(temp->item->idle_time)); temp->item->type = type; temp->item->status = SESMAN_SESSION_STATUS_ACTIVE; temp->next = g_sessions; g_sessions = temp; g_session_count++; return display; } g_free(temp->item); g_free(temp); return display; } /******************************************************************************/ /* called with the main thread */ static int session_reconnect_fork(int display, char *username, long data) { int pid; pid = g_fork(); if (pid == -1) { } else if (pid == 0) { env_set_user(username, 0, display, g_cfg->env_names, g_cfg->env_values); auth_set_env(data); if (g_file_exist(g_cfg->reconnect_sh)) { g_execlp3(g_cfg->reconnect_sh, g_cfg->reconnect_sh, 0); } g_exit(0); } return display; } /******************************************************************************/ /* called by a worker thread, ask the main thread to call session_sync_start and wait till done */ int session_start(long data, tui8 type, struct SCP_CONNECTION *c, struct SCP_SESSION *s) { return session_start_fork(data, type, c, s); } /******************************************************************************/ /* called by a worker thread, ask the main thread to call session_sync_start and wait till done */ int session_reconnect(int display, char *username, long data) { return session_reconnect_fork(display, username, data); } /******************************************************************************/ int session_kill(int pid) { struct session_chain *tmp; struct session_chain *prev; tmp = g_sessions; prev = 0; while (tmp != 0) { if (tmp->item == 0) { log_message(LOG_LEVEL_ERROR, "session descriptor for " "pid %d is null!", pid); if (prev == 0) { /* prev does no exist, so it's the first element - so we set g_sessions */ g_sessions = tmp->next; } else { prev->next = tmp->next; } return SESMAN_SESSION_KILL_NULLITEM; } if (tmp->item->pid == pid) { /* deleting the session */ log_message(LOG_LEVEL_INFO, "++ terminated session: username %s, display :%d.0, session_pid %d, ip %s", tmp->item->name, tmp->item->display, tmp->item->pid, tmp->item->client_ip); g_free(tmp->item); if (prev == 0) { /* prev does no exist, so it's the first element - so we set g_sessions */ g_sessions = tmp->next; } else { prev->next = tmp->next; } g_free(tmp); g_session_count--; return SESMAN_SESSION_KILL_OK; } /* go on */ prev = tmp; tmp = tmp->next; } return SESMAN_SESSION_KILL_NOTFOUND; } /******************************************************************************/ void session_sigkill_all(void) { struct session_chain *tmp; tmp = g_sessions; while (tmp != 0) { if (tmp->item == 0) { log_message(LOG_LEVEL_ERROR, "found null session " "descriptor!"); } else { g_sigterm(tmp->item->pid); } /* go on */ tmp = tmp->next; } } /******************************************************************************/ struct session_item * session_get_bypid(int pid) { struct session_chain *tmp; struct session_item *dummy; dummy = g_new0(struct session_item, 1); if (0 == dummy) { log_message(LOG_LEVEL_ERROR, "session_get_bypid: out of memory"); return 0; } tmp = g_sessions; while (tmp != 0) { if (tmp->item == 0) { log_message(LOG_LEVEL_ERROR, "session descriptor for " "pid %d is null!", pid); g_free(dummy); return 0; } if (tmp->item->pid == pid) { g_memcpy(dummy, tmp->item, sizeof(struct session_item)); return dummy; } /* go on */ tmp = tmp->next; } g_free(dummy); return 0; } /******************************************************************************/ struct SCP_DISCONNECTED_SESSION * session_get_byuser(const char *user, int *cnt, unsigned char flags) { struct session_chain *tmp; struct SCP_DISCONNECTED_SESSION *sess; int count; int index; count = 0; tmp = g_sessions; while (tmp != 0) { LOG_DBG("user: %s", user); if ((NULL == user) || (!g_strncasecmp(user, tmp->item->name, 256))) { LOG_DBG("session_get_byuser: status=%d, flags=%d, " "result=%d", (tmp->item->status), flags, ((tmp->item->status) & flags)); if ((tmp->item->status) & flags) { count++; } } /* go on */ tmp = tmp->next; } if (count == 0) { (*cnt) = 0; return 0; } /* malloc() an array of disconnected sessions */ sess = g_new0(struct SCP_DISCONNECTED_SESSION, count); if (sess == 0) { (*cnt) = 0; return 0; } tmp = g_sessions; index = 0; while (tmp != 0) { /* #warning FIXME: we should get only disconnected sessions! */ if ((NULL == user) || (!g_strncasecmp(user, tmp->item->name, 256))) { if ((tmp->item->status) & flags) { (sess[index]).SID = tmp->item->pid; (sess[index]).type = tmp->item->type; (sess[index]).height = tmp->item->height; (sess[index]).width = tmp->item->width; (sess[index]).bpp = tmp->item->bpp; /* #warning FIXME: setting idle times and such */ /*(sess[index]).connect_time.year = tmp->item->connect_time.year; (sess[index]).connect_time.month = tmp->item->connect_time.month; (sess[index]).connect_time.day = tmp->item->connect_time.day; (sess[index]).connect_time.hour = tmp->item->connect_time.hour; (sess[index]).connect_time.minute = tmp->item->connect_time.minute; (sess[index]).disconnect_time.year = tmp->item->disconnect_time.year; (sess[index]).disconnect_time.month = tmp->item->disconnect_time.month; (sess[index]).disconnect_time.day = tmp->item->disconnect_time.day; (sess[index]).disconnect_time.hour = tmp->item->disconnect_time.hour; (sess[index]).disconnect_time.minute = tmp->item->disconnect_time.minute; (sess[index]).idle_time.year = tmp->item->idle_time.year; (sess[index]).idle_time.month = tmp->item->idle_time.month; (sess[index]).idle_time.day = tmp->item->idle_time.day; (sess[index]).idle_time.hour = tmp->item->idle_time.hour; (sess[index]).idle_time.minute = tmp->item->idle_time.minute;*/ (sess[index]).conn_year = tmp->item->connect_time.year; (sess[index]).conn_month = tmp->item->connect_time.month; (sess[index]).conn_day = tmp->item->connect_time.day; (sess[index]).conn_hour = tmp->item->connect_time.hour; (sess[index]).conn_minute = tmp->item->connect_time.minute; (sess[index]).idle_days = tmp->item->idle_time.day; (sess[index]).idle_hours = tmp->item->idle_time.hour; (sess[index]).idle_minutes = tmp->item->idle_time.minute; index++; } } /* go on */ tmp = tmp->next; } (*cnt) = count; return sess; } /******************************************************************************/ int cleanup_sockets(int display) { log_message(LOG_LEVEL_DEBUG, "cleanup_sockets:"); char file[256]; int error; error = 0; g_snprintf(file, 255, CHANSRV_PORT_OUT_STR, display); if (g_file_exist(file)) { log_message(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { log_message(LOG_LEVEL_DEBUG, "cleanup_sockets: failed to delete %s", file); error++; } } g_snprintf(file, 255, CHANSRV_PORT_IN_STR, display); if (g_file_exist(file)) { log_message(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { log_message(LOG_LEVEL_DEBUG, "cleanup_sockets: failed to delete %s", file); error++; } } g_snprintf(file, 255, XRDP_CHANSRV_STR, display); if (g_file_exist(file)) { log_message(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { log_message(LOG_LEVEL_DEBUG, "cleanup_sockets: failed to delete %s", file); error++; } } g_snprintf(file, 255, CHANSRV_API_STR, display); if (g_file_exist(file)) { log_message(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { log_message(LOG_LEVEL_DEBUG, "cleanup_sockets: failed to delete %s", file); error++; } } return error; } xrdp-0.9.12/sesman/scp_v1.h000644 001751 001751 00000001767 13544635323 015355 0ustar00metameta000000 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_v1.h * @brief scp version 1 declarations * @author Simone Fedele * */ #ifndef SCP_V1_H #define SCP_V1_H /** * * @brief processes the stream using scp version 1 * @param in_sck connection socket * @param in_s input stream * @param out_s output stream * */ void scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s); #endif xrdp-0.9.12/sesman/config.c000644 001751 001751 00000040713 13601643631 015407 0ustar00metameta000000 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 "list.h" #include "file.h" #include "sesman.h" #include "log.h" /******************************************************************************/ int config_read(struct config_sesman *cfg) { int fd; struct list *sec; struct list *param_n; struct list *param_v; char cfg_file[256]; g_snprintf(cfg_file, 255, "%s/sesman.ini", XRDP_CFG_PATH); fd = g_file_open(cfg_file); if (-1 == fd) { return 1; } g_memset(cfg, 0, sizeof(struct config_sesman)); 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; /* read global config */ config_read_globals(fd, cfg, param_n, param_v); /* read Xvnc/X11rdp/Xorg parameter list */ config_read_vnc_params(fd, cfg, param_n, param_v); config_read_rdp_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); return 0; } /******************************************************************************/ int config_read_globals(int file, struct config_sesman *cf, struct list *param_n, struct list *param_v) { int i; int length; char *buf; list_clear(param_v); list_clear(param_n); /* resetting the struct */ cf->listen_address[0] = '\0'; cf->listen_port[0] = '\0'; cf->enable_user_wm = 0; cf->user_wm[0] = '\0'; 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++) { buf = (char *)list_get_item(param_n, i); if (0 == g_strcasecmp(buf, SESMAN_CFG_DEFWM)) { cf->default_wm = g_strdup((char *)list_get_item(param_v, i)); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_USERWM)) { g_strncpy(cf->user_wm, (char *)list_get_item(param_v, i), 31); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_ENABLE_USERWM)) { cf->enable_user_wm = g_text2bool((char *)list_get_item(param_v, i)); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_PORT)) { g_strncpy(cf->listen_port, (char *)list_get_item(param_v, i), 15); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_ADDRESS)) { g_strncpy(cf->listen_address, (char *)list_get_item(param_v, i), 31); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_AUTH_FILE_PATH)) { cf->auth_file_path = g_strdup((char *)list_get_item(param_v, i)); } else if (g_strcasecmp(buf, SESMAN_CFG_RECONNECT_SH) == 0) { cf->reconnect_sh = g_strdup((char *)list_get_item(param_v, i)); } } /* checking for missing required parameters */ if ('\0' == cf->listen_address[0]) { g_strncpy(cf->listen_address, "0.0.0.0", 8); } if ('\0' == cf->listen_port[0]) { g_strncpy(cf->listen_port, "3350", 5); } if ('\0' == cf->user_wm[0]) { cf->enable_user_wm = 0; } if (cf->default_wm == 0) { cf->default_wm = g_strdup("startwm.sh"); } else if (g_strlen(cf->default_wm) == 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 */ length = sizeof(XRDP_CFG_PATH) + g_strlen(cf->default_wm) + 1; /* '/' */ 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 = g_strdup(buf); g_free(buf); } if (cf->reconnect_sh == 0) { cf->reconnect_sh = g_strdup("reconnectwm.sh"); } else if (g_strlen(cf->reconnect_sh) == 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 */ length = sizeof(XRDP_CFG_PATH) + g_strlen(cf->reconnect_sh) + 1; /* '/' */ 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 = g_strdup(buf); g_free(buf); } return 0; } /******************************************************************************/ int config_read_security(int file, struct config_security *sc, struct list *param_n, struct list *param_v) { int i; int gid; char *buf; list_clear(param_v); list_clear(param_n); /* setting defaults */ sc->allow_root = 0; sc->login_retry = 3; sc->ts_users_enable = 0; sc->ts_admins_enable = 0; sc->restrict_outbound_clipboard = 0; file_read_section(file, SESMAN_CFG_SECURITY, 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_SEC_ALLOW_ROOT)) { sc->allow_root = g_text2bool((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_LOGIN_RETRY)) { sc->login_retry = g_atoi((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_USR_GROUP)) { if (g_getgroup_info((char *)list_get_item(param_v, i), &gid) == 0) { sc->ts_users_enable = 1; sc->ts_users = gid; } } if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_ADM_GROUP)) { if (g_getgroup_info((char *)list_get_item(param_v, i), &gid) == 0) { sc->ts_admins_enable = 1; sc->ts_admins = gid; } } if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_ALWAYSGROUPCHECK)) { sc->ts_always_group_check = g_text2bool((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_RESTRICT_OUTBOUND_CLIPBOARD)) { sc->restrict_outbound_clipboard = g_text2bool((char *)list_get_item(param_v, i)); } } return 0; } /******************************************************************************/ int config_read_sessions(int file, struct config_sessions *se, struct list *param_n, struct list *param_v) { int i; char *buf; list_clear(param_v); list_clear(param_n); /* setting defaults */ se->x11_display_offset = 10; se->max_sessions = 0; se->max_idle_time = 0; se->max_disc_time = 0; se->kill_disconnected = 0; se->policy = SESMAN_CFG_SESS_POLICY_DFLT; file_read_section(file, SESMAN_CFG_SESSIONS, 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_SESS_X11DISPLAYOFFSET)) { se->x11_display_offset = g_atoi((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_MAX)) { se->max_sessions = g_atoi((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_KILL_DISC)) { se->kill_disconnected = g_text2bool((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_IDLE_LIMIT)) { se->max_idle_time = g_atoi((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_DISC_LIMIT)) { se->max_disc_time = g_atoi((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_POLICY_S)) { char *value = (char *)list_get_item(param_v, i); if (0 == g_strcasecmp(value, SESMAN_CFG_SESS_POLICY_DFLT_S)) { se->policy = SESMAN_CFG_SESS_POLICY_DFLT; } else if (0 == g_strcasecmp(value, SESMAN_CFG_SESS_POLICY_UBD_S)) { se->policy = SESMAN_CFG_SESS_POLICY_UBD; } else if (0 == g_strcasecmp(value, SESMAN_CFG_SESS_POLICY_UBI_S)) { se->policy = SESMAN_CFG_SESS_POLICY_UBI; } else if (0 == g_strcasecmp(value, SESMAN_CFG_SESS_POLICY_UBC_S)) { se->policy = SESMAN_CFG_SESS_POLICY_UBC; } else if (0 == g_strcasecmp(value, SESMAN_CFG_SESS_POLICY_UBDI_S)) { se->policy = SESMAN_CFG_SESS_POLICY_UBDI; } else if (0 == g_strcasecmp(value, SESMAN_CFG_SESS_POLICY_UBDC_S)) { se->policy = SESMAN_CFG_SESS_POLICY_UBDC; } else /* silently ignore typos */ { se->policy = SESMAN_CFG_SESS_POLICY_DFLT; } } } return 0; } /******************************************************************************/ int config_read_rdp_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->rdp_params = list_create(); cs->rdp_params->auto_free = 1; file_read_section(file, SESMAN_CFG_RDP_PARAMS, param_n, param_v); for (i = 0; i < param_n->count; i++) { list_add_item(cs->rdp_params, (long)g_strdup((char *)list_get_item(param_v, i))); } return 0; } /******************************************************************************/ 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_item(cs->xorg_params, (long) g_strdup((char *) list_get_item(param_v, i))); } return 0; } /******************************************************************************/ 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_item(cs->vnc_params, (long)g_strdup((char *)list_get_item(param_v, i))); } return 0; } /******************************************************************************/ 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_item(cs->env_names, (tintptr) g_strdup((char *) list_get_item(param_n, i))); list_add_item(cs->env_values, (tintptr) g_strdup((char *) list_get_item(param_v, i))); } return 0; } void config_dump(struct config_sesman *config) { int i; struct config_sessions *se; struct config_security *sc; se = &(config->sess); sc = &(config->sec); /* Global sesman configuration */ g_writeln("Global configuration:"); g_writeln(" ListenAddress: %s", config->listen_address); 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 */ 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: %d", se->policy); /* 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(" RestrictOutboundClipboard: %d", sc->restrict_outbound_clipboard); g_printf( " TSUsersGroup: "); if (sc->ts_users_enable) { g_printf("%d", sc->ts_users); } else { g_printf("(not defined)"); } g_writeln("%s", ""); g_printf( " TSAdminsGroup: "); if (sc->ts_admins_enable) { g_printf("%d", sc->ts_admins); } else { g_printf("(not defined)"); } g_writeln("%s", ""); /* 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)); } /* X11rdp */ if (config->rdp_params->count) { g_writeln("X11rdp parameters:"); } for (i = 0; i < config->rdp_params->count; i++) { g_writeln(" Parameter %02d %s", i, (char *)list_get_item(config->rdp_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) { g_free(cs->default_wm); g_free(cs->reconnect_sh); g_free(cs->auth_file_path); list_delete(cs->rdp_params); list_delete(cs->vnc_params); list_delete(cs->xorg_params); list_delete(cs->env_names); list_delete(cs->env_values); g_free(cs); } xrdp-0.9.12/sesman/env.c000644 001751 001751 00000017571 13544635323 014745 0ustar00metameta000000 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 "xrdp_sockets.h" #include "list.h" #include "sesman.h" #include "ssl_calls.h" extern unsigned char g_fixedkey[8]; /* in sesman.c */ extern struct config_sesman *g_cfg; /* in sesman.c */ /******************************************************************************/ 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_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; 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_message(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(const char *username, char **passwd_file, int display, const struct list *env_names, const struct list *env_values) { int error; int pw_uid; int pw_gid; int uid; int index; int len; char *name; char *value; char *pw_shell; char *pw_dir; char text[256]; char hostname[256]; pw_shell = 0; pw_dir = 0; error = g_getuser_info(username, &pw_gid, &pw_uid, &pw_shell, &pw_dir, 0); if (error == 0) { g_rm_temp_dir(); error = g_setgid(pw_gid); if (error == 0) { error = g_initgroups(username, pw_gid); } if (error == 0) { uid = pw_uid; error = g_setuid(uid); } g_mk_socket_path(0); if (error == 0) { g_clearenv(); g_setenv("SHELL", pw_shell, 1); g_setenv("PATH", "/sbin:/bin:/usr/bin:/usr/local/bin", 1); g_setenv("USER", username, 1); g_setenv("LOGNAME", username, 1); g_sprintf(text, "%d", uid); g_setenv("UID", text, 1); g_setenv("HOME", pw_dir, 1); g_set_current_dir(pw_dir); g_sprintf(text, ":%d.0", display); g_setenv("DISPLAY", text, 1); g_setenv("XRDP_SESSION", "1", 1); /* XRDP_SOCKET_PATH should be set even here, chansrv uses this */ g_setenv("XRDP_SOCKET_PATH", XRDP_SOCKET_PATH, 1); /* pulse sink socket */ g_snprintf(text, sizeof(text) - 1, CHANSRV_PORT_OUT_BASE_STR, display); g_setenv("XRDP_PULSE_SINK_SOCKET", text, 1); /* pulse source socket */ g_snprintf(text, sizeof(text) - 1, 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_message(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, username, hostname, display); *passwd_file = (char *) g_malloc(len + 1, 1); if (*passwd_file != NULL) { /* Try legacy names first, remove if found */ g_sprintf(*passwd_file, "%s/.vnc/sesman_%s_passwd:%d", pw_dir, username, display); if (g_file_exist(*passwd_file)) { log_message(LOG_LEVEL_WARNING, "Removing old " "password file %s", *passwd_file); g_file_delete(*passwd_file); } g_sprintf(*passwd_file, "%s/.vnc/sesman_%s_passwd", pw_dir, username); if (g_file_exist(*passwd_file)) { log_message(LOG_LEVEL_WARNING, "Removing insecure " "password file %s", *passwd_file); g_file_delete(*passwd_file); } g_sprintf(*passwd_file, "%s/.vnc/sesman_passwd-%s@%s:%d", pw_dir, username, hostname, display); } } else { /* we use auth_file_path as requested */ len = g_snprintf(NULL, 0, g_cfg->auth_file_path, username); *passwd_file = (char *) g_malloc(len + 1, 1); if (*passwd_file != NULL) { g_sprintf(*passwd_file, g_cfg->auth_file_path, username); } } if (*passwd_file != NULL) { LOG_DBG("pass file: %s", *passwd_file); } } g_free(pw_dir); g_free(pw_shell); } } else { log_message(LOG_LEVEL_ERROR, "error getting user info for user %s", username); } return error; } xrdp-0.9.12/sesman/scp_v1_mng.h000644 001751 001751 00000002020 13544635323 016175 0ustar00metameta000000 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_v1.h * @brief scp version 1 declarations - management * @author Simone Fedele * */ #ifndef SCP_V1_MNG_H #define SCP_V1_MNG_H /** * * @brief processes the stream using scp version 1 * @param in_sck connection socket * @param in_s input stream * @param out_s output stream * */ void scp_v1_mng_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s); #endif xrdp-0.9.12/sesman/sesman.ini000644 001751 001751 00000006043 13601646134 015764 0ustar00metameta000000 000000 ;; See `man 5 sesman.ini` for details [Globals] ListenAddress=127.0.0.1 ListenPort=3350 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=true clipboard from the ; server is not pushed to the client. RestrictOutboundClipboard=false [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 ;; KillDisconnected - kill disconnected sessions ; Type: boolean ; Default: false ; if 1, true, or yes, kill session after 60 seconds KillDisconnected=false ;; DisconnectedTimeLimit - when to kill idle sessions ; Type: integer ; Default: 0 ; if not zero, the seconds before a disconnected session is killed ; min 60 seconds DisconnectedTimeLimit=0 ;; IdleTimeLimit (specify in second) - 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" | "UBD" | "UBI" | "UBC" | "UBDI" | "UBDC" ] ; Default: Xrdp: and Xvnc: ; "UBD" session per ; "UBI" session per ; "UBC" session per ; "UBDI" session per ; "UBDC" session per Policy=Default [Logging] LogFile=xrdp-sesman.log LogLevel=DEBUG EnableSyslog=1 SyslogLevel=DEBUG ; ; 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. The typical path is shown 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-server/Xorg ; CentOS 7 : param=/usr/bin/Xorg or param=Xorg ; param=Xorg ; Leave the rest paramaters 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, defaults to xrdp_client if not set FuseMountName=thinclient_drives ; this value allows only the user to acess their own mapped drives. ; Make this more permissive (e.g. 022) if required. FileUmask=077 [SessionVariables] PULSE_SCRIPT=/etc/xrdp/pulse/default.pa xrdp-0.9.12/sesman/chansrv/000755 001751 001751 00000000000 13601646134 015436 5ustar00metameta000000 000000 xrdp-0.9.12/sesman/reconnectwm.sh000755 001751 001751 00000000104 13544635323 016654 0ustar00metameta000000 000000 #!/bin/sh # Write procedures here you want to execute on reconnect xrdp-0.9.12/sesman/access.c000644 001751 001751 00000006270 13544635323 015410 0ustar00metameta000000 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 access.c * @brief User access control code * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "sesman.h" extern struct config_sesman *g_cfg; /* in sesman.c */ /******************************************************************************/ int access_login_allowed(const char *user) { int gid; int ok; if ((0 == g_strncmp(user, "root", 5)) && (0 == g_cfg->sec.allow_root)) { log_message(LOG_LEVEL_WARNING, "ROOT login attempted, but root login is disabled"); return 0; } if ((0 == g_cfg->sec.ts_users_enable) && (0==g_cfg->sec.ts_always_group_check)) { LOG_DBG("Terminal Server Users group is disabled, allowing authentication", 1); return 1; } if (0 != g_getuser_info(user, &gid, 0, 0, 0, 0)) { log_message(LOG_LEVEL_ERROR, "Cannot read user info! - login denied"); return 0; } if (g_cfg->sec.ts_users == gid) { log_message(LOG_LEVEL_DEBUG,"ts_users is user's primary group"); return 1; } if (0 != g_check_user_in_group(user, g_cfg->sec.ts_users, &ok)) { log_message(LOG_LEVEL_ERROR, "Cannot read group info! - login denied"); return 0; } if (ok) { return 1; } log_message(LOG_LEVEL_INFO, "login denied for user %s", user); return 0; } /******************************************************************************/ int access_login_mng_allowed(const char *user) { int gid; int ok; if ((0 == g_strncmp(user, "root", 5)) && (0 == g_cfg->sec.allow_root)) { log_message(LOG_LEVEL_WARNING, "[MNG] ROOT login attempted, but root login is disabled"); return 0; } if (0 == g_cfg->sec.ts_admins_enable) { LOG_DBG("[MNG] Terminal Server Admin group is disabled, " "allowing authentication", 1); return 1; } if (0 != g_getuser_info(user, &gid, 0, 0, 0, 0)) { log_message(LOG_LEVEL_ERROR, "[MNG] Cannot read user info! - login denied"); return 0; } if (g_cfg->sec.ts_admins == gid) { LOG_DBG("[MNG] ts_users is user's primary group"); return 1; } if (0 != g_check_user_in_group(user, g_cfg->sec.ts_admins, &ok)) { log_message(LOG_LEVEL_ERROR, "[MNG] Cannot read group info! - login denied"); return 0; } if (ok) { return 1; } log_message(LOG_LEVEL_INFO, "[MNG] login denied for user %s", user); return 0; } xrdp-0.9.12/sesman/tools/000755 001751 001751 00000000000 13601646134 015132 5ustar00metameta000000 000000 xrdp-0.9.12/sesman/verify_user.c000644 001751 001751 00000015251 13544635323 016510 0ustar00metameta000000 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 "sesman.h" #include #include #include #include #include #include #ifndef SECS_PER_DAY #define SECS_PER_DAY (24L*3600L) #endif extern struct config_sesman *g_cfg; /* in sesman.c */ static int auth_crypt_pwd(const char *pwd, const char *pln, char *crp); static int auth_account_disabled(struct spwd *stp); /******************************************************************************/ /* returns boolean */ long auth_userpass(const char *user, const char *pass, int *errorcode) { const char *encr; const char *epass; struct passwd *spw; struct spwd *stp; spw = getpwnam(user); if (spw == 0) { return 0; } if (g_strncmp(spw->pw_passwd, "x", 3) == 0) { /* the system is using shadow */ stp = getspnam(user); if (stp == 0) { return 0; } if (1 == auth_account_disabled(stp)) { log_message(LOG_LEVEL_INFO, "account %s is disabled", user); return 0; } encr = stp->sp_pwdp; } else { /* old system with only passwd */ encr = spw->pw_passwd; } epass = crypt(pass, encr); if (epass == 0) { return 0; } return (strcmp(encr, epass) == 0); } /******************************************************************************/ /* returns error */ int auth_start_session(long in_val, int in_display) { return 0; } /******************************************************************************/ /* returns error */ int auth_stop_session(long in_val) { return 0; } /******************************************************************************/ int auth_end(long in_val) { return 0; } /******************************************************************************/ int auth_set_env(long in_val) { 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_DBG("last %d", stp->sp_lstchg); LOG_DBG("min %d", stp->sp_min); LOG_DBG("max %d", stp->sp_max); LOG_DBG("inact %d", stp->sp_inact); LOG_DBG("warn %d", stp->sp_warn); LOG_DBG("expire %d", stp->sp_expire); LOG_DBG("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.9.12/sesman/verify_user_pam_userpass.c000644 001751 001751 00000004712 13544635323 021272 0ustar00metameta000000 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_userpass.c * @brief Authenticate user using pam_userpass module * @author Jay Sorg * */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "os_calls.h" #include #define SERVICE "xrdp" /******************************************************************************/ /* returns boolean */ int auth_userpass(const char *user, const char *pass, int *errorcode) { pam_handle_t *pamh; pam_userpass_t userpass; struct pam_conv conv = {pam_userpass_conv, &userpass}; const void *template1; int status; userpass.user = user; userpass.pass = pass; if (pam_start(SERVICE, user, &conv, &pamh) != PAM_SUCCESS) { return 0; } status = pam_authenticate(pamh, 0); if (status != PAM_SUCCESS) { pam_end(pamh, status); return 0; } status = pam_acct_mgmt(pamh, 0); if (status != PAM_SUCCESS) { pam_end(pamh, status); return 0; } status = pam_get_item(pamh, PAM_USER, &template1); if (status != PAM_SUCCESS) { pam_end(pamh, status); return 0; } if (pam_end(pamh, PAM_SUCCESS) != PAM_SUCCESS) { return 0; } return 1; } /******************************************************************************/ /* returns error */ int auth_start_session(long in_val, int in_display) { return 0; } /******************************************************************************/ /* returns error */ int auth_stop_session(long in_val) { return 0; } /******************************************************************************/ int auth_end(long in_val) { return 0; } /******************************************************************************/ int auth_set_env(long in_val) { return 0; } xrdp-0.9.12/sesman/scp_v0.h000644 001751 001751 00000002014 13544635323 015336 0ustar00metameta000000 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_v0.h * @brief scp version 0 declarations * @author Simone Fedele * */ #ifndef SCP_V0_H #define SCP_V0_H #include "libscp.h" /** * * @brief processes the stream using scp version 0 * @param in_sck connection socket * @param in_s input stream * @param out_s output stream * */ void scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s); #endif xrdp-0.9.12/sesman/tools/tcp.h000644 001751 001751 00000002743 13544635323 016103 0ustar00metameta000000 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 tcp.h * @brief Tcp stream functions declarations * @author Jay Sorg, Simone Fedele * */ #ifndef TCP_H #define TCP_H /** * * @brief Force receiving data from tcp stream * @param sck The socket to read from * @param data Data buffer * @param len Data buffer size * @return 0 on success, 1 on error * */ int tcp_force_recv(int sck, char* data, int len); /** * * @brief Force sending data to tcp stream * @param sck the socket to write to * @param data Data buffer * @param len Data buffer size * @return 0 on success, 1 on error * */ int tcp_force_send(int sck, char* data, int len); /** * * @brief Binds the listening socket * @param sck Listening socket * @param addr Listening address * @param port Listening port * @return 0 on success, -1 on error * */ int tcp_bind(int sck, char* addr, char* port); #endif xrdp-0.9.12/sesman/tools/xcon.c000644 001751 001751 00000002562 13544635323 016256 0ustar00metameta000000 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 Display *g_display = 0; int g_x_socket = 0; int main(int argc, char **argv) { fd_set rfds; 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) { FD_ZERO(&rfds); FD_SET(g_x_socket, &rfds); i1 = select(g_x_socket + 1, &rfds, 0, 0, 0); if (i1 < 0) { break; } XNextEvent(g_display, &xevent); } return 0; } xrdp-0.9.12/sesman/tools/Makefile.am000644 001751 001751 00000002060 13544635323 017170 0ustar00metameta000000 000000 AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_SOCKET_PATH=\"${socketdir}\" \ -I$(top_srcdir)/common \ -I$(top_srcdir)/sesman/libscp \ -I$(top_srcdir)/sesman if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif AM_CFLAGS = $(X_CFLAGS) bin_PROGRAMS = \ xrdp-sesrun \ xrdp-sesadmin \ xrdp-dis noinst_PROGRAMS = \ xrdp-sestest \ xrdp-xcon xrdp_sesrun_SOURCES = \ config.c \ sesrun.c \ tcp.c \ tcp.h xrdp_sestest_SOURCES = \ sestest.c xrdp_sesadmin_SOURCES = \ sesadmin.c xrdp_dis_SOURCES = \ dis.c xrdp_xcon_SOURCES = \ xcon.c xrdp_sesrun_LDADD = \ $(top_builddir)/common/libcommon.la xrdp_sestest_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libscp/libscp.la xrdp_sesadmin_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libscp/libscp.la xrdp_xcon_LDFLAGS = \ $(X_LIBS) xrdp_xcon_LDADD = \ $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) xrdp-0.9.12/sesman/tools/config.c000644 001751 001751 00000000121 13544635323 016541 0ustar00metameta000000 000000 #if defined(HAVE_CONFIG_H) #include #endif #include "../config.c" xrdp-0.9.12/sesman/tools/sesadmin.c000644 001751 001751 00000013501 13544635323 017105 0ustar00metameta000000 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 "tcp.h" #include "libscp.h" #include "parse.h" #include "log.h" #include "libscp.h" #include #include char user[257]; char pass[257]; char cmnd[257]; char serv[257]; char port[257]; struct log_config logging; void cmndList(struct SCP_CONNECTION *c); void cmndKill(struct SCP_CONNECTION *c, struct SCP_SESSION *s); void cmndHelp(void); int inputSession(struct SCP_SESSION *s); unsigned int menuSelect(unsigned int choices); int main(int argc, char **argv) { struct SCP_SESSION *s; struct SCP_CONNECTION *c; enum SCP_CLIENT_STATES_E e; //int end; int idx; //int sel; int sock; char *pwd; user[0] = '\0'; pass[0] = '\0'; cmnd[0] = '\0'; serv[0] = '\0'; port[0] = '\0'; logging.program_name = "sesadmin"; logging.log_file = g_strdup("xrdp-sesadmin.log"); logging.log_level = LOG_LEVEL_DEBUG; logging.enable_syslog = 0; log_start_from_param(&logging); for (idx = 0; idx < argc; idx++) { if (0 == g_strncmp(argv[idx], "-u=", 3)) { g_strncpy(user, (argv[idx]) + 3, 256); } else if (0 == g_strncmp(argv[idx], "-p=", 3)) { g_strncpy(pass, (argv[idx]) + 3, 256); } else if (0 == g_strncmp(argv[idx], "-s=", 3)) { g_strncpy(serv, (argv[idx]) + 3, 256); } 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(serv, "", 1)) { g_strncpy(serv, "localhost", 256); } if (0 == g_strncmp(port, "", 1)) { g_strncpy(port, "3350", 256); } if (0 == g_strncmp(user, "", 1)) { cmndHelp(); return 0; } if (0 == g_strncmp(cmnd, "", 1)) { cmndHelp(); return 0; } if (0 == g_strncmp(pass, "", 1)) { pwd = getpass("password:"); g_strncpy(pass, pwd, 256); /* zeroing the password */ while ((*pwd) != '\0') { (*pwd) = 0x00; pwd++; } } scp_init(); sock = g_tcp_socket(); if (sock < 0) { LOG_DBG("Socket open error, g_tcp_socket() failed"); return 1; } s = scp_session_create(); c = scp_connection_create(sock); LOG_DBG("Connecting to %s:%s with user %s (%s)", serv, port, user, pass); if (0 != g_tcp_connect(sock, serv, port)) { LOG_DBG("g_tcp_connect() error"); return 1; } scp_session_set_type(s, SCP_SESSION_TYPE_MANAGE); scp_session_set_version(s, 1); scp_session_set_username(s, user); scp_session_set_password(s, pass); e = scp_v1c_mng_connect(c, s); if (SCP_CLIENT_STATE_OK != e) { LOG_DBG("libscp error connecting: %s %d", s->errstr, (int)e); } if (0 == g_strncmp(cmnd, "list", 5)) { cmndList(c); } else if (0 == g_strncmp(cmnd, "kill:", 5)) { cmndKill(c, s); } g_tcp_close(sock); scp_session_destroy(s); scp_connection_destroy(c); log_end(); return 0; } void cmndHelp(void) { fprintf(stderr, "sesadmin - a console sesman administration tool\n"); fprintf(stderr, "syntax: sesadmin [] COMMAND [OPTIONS]\n\n"); fprintf(stderr, "-u=: username to connect to sesman [MANDATORY]\n"); fprintf(stderr, "-p=: password to connect to sesman (asked if not given)\n"); fprintf(stderr, "-s=: sesman host (default is localhost)\n"); fprintf(stderr, "-i= : sesman port (default 3350)\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_DISCONNECTED_SESSION *s) { printf("Session ID: %d\n", s->SID); printf("\tSession type: %d\n", s->type); printf("\tScreen size: %dx%d, color depth %d\n", s->width, s->height, s->bpp); printf("\tIdle time: %d day(s) %d hour(s) %d minute(s)\n", s->idle_days, s->idle_hours, s->idle_minutes); printf("\tConnected: %04d/%02d/%02d %02d:%02d\n", s->conn_year, s->conn_month, s->conn_day, s->conn_hour, s->conn_minute); } void cmndList(struct SCP_CONNECTION *c) { struct SCP_DISCONNECTED_SESSION *dsl; enum SCP_CLIENT_STATES_E e; int scnt; int idx; e = scp_v1c_mng_get_session_list(c, &scnt, &dsl); if (e != SCP_CLIENT_STATE_LIST_OK) { printf("Error getting session list.\n"); return; } if (scnt > 0) { for (idx = 0; idx < scnt; idx++) { print_session(&dsl[idx]); } } else { printf("No sessions.\n"); } g_free(dsl); } void cmndKill(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { } xrdp-0.9.12/sesman/tools/Makefile.in000644 001751 001751 00000060726 13601646126 017213 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG bin_PROGRAMS = xrdp-sesrun$(EXEEXT) xrdp-sesadmin$(EXEEXT) \ xrdp-dis$(EXEEXT) noinst_PROGRAMS = xrdp-sestest$(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_dis_OBJECTS = dis.$(OBJEXT) xrdp_dis_OBJECTS = $(am_xrdp_dis_OBJECTS) xrdp_dis_LDADD = $(LDADD) 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_sesadmin_OBJECTS = sesadmin.$(OBJEXT) xrdp_sesadmin_OBJECTS = $(am_xrdp_sesadmin_OBJECTS) xrdp_sesadmin_DEPENDENCIES = $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libscp/libscp.la am_xrdp_sesrun_OBJECTS = config.$(OBJEXT) sesrun.$(OBJEXT) \ tcp.$(OBJEXT) xrdp_sesrun_OBJECTS = $(am_xrdp_sesrun_OBJECTS) xrdp_sesrun_DEPENDENCIES = $(top_builddir)/common/libcommon.la am_xrdp_sestest_OBJECTS = sestest.$(OBJEXT) xrdp_sestest_OBJECTS = $(am_xrdp_sestest_OBJECTS) xrdp_sestest_DEPENDENCIES = $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libscp/libscp.la am_xrdp_xcon_OBJECTS = xcon.$(OBJEXT) xrdp_xcon_OBJECTS = $(am_xrdp_xcon_OBJECTS) am__DEPENDENCIES_1 = 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)/config.Po ./$(DEPDIR)/dis.Po \ ./$(DEPDIR)/sesadmin.Po ./$(DEPDIR)/sesrun.Po \ ./$(DEPDIR)/sestest.Po ./$(DEPDIR)/tcp.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_dis_SOURCES) $(xrdp_sesadmin_SOURCES) \ $(xrdp_sesrun_SOURCES) $(xrdp_sestest_SOURCES) \ $(xrdp_xcon_SOURCES) DIST_SOURCES = $(xrdp_dis_SOURCES) $(xrdp_sesadmin_SOURCES) \ $(xrdp_sesrun_SOURCES) $(xrdp_sestest_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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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\" \ -DXRDP_SOCKET_PATH=\"${socketdir}\" -I$(top_srcdir)/common \ -I$(top_srcdir)/sesman/libscp -I$(top_srcdir)/sesman \ $(am__append_1) AM_CFLAGS = $(X_CFLAGS) xrdp_sesrun_SOURCES = \ config.c \ sesrun.c \ tcp.c \ tcp.h xrdp_sestest_SOURCES = \ sestest.c xrdp_sesadmin_SOURCES = \ sesadmin.c xrdp_dis_SOURCES = \ dis.c xrdp_xcon_SOURCES = \ xcon.c xrdp_sesrun_LDADD = \ $(top_builddir)/common/libcommon.la xrdp_sestest_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libscp/libscp.la xrdp_sesadmin_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libscp/libscp.la xrdp_xcon_LDFLAGS = \ $(X_LIBS) xrdp_xcon_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 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)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list 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-sestest$(EXEEXT): $(xrdp_sestest_OBJECTS) $(xrdp_sestest_DEPENDENCIES) $(EXTRA_xrdp_sestest_DEPENDENCIES) @rm -f xrdp-sestest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_sestest_OBJECTS) $(xrdp_sestest_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)/config.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)/sestest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcp.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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/config.Po -rm -f ./$(DEPDIR)/dis.Po -rm -f ./$(DEPDIR)/sesadmin.Po -rm -f ./$(DEPDIR)/sesrun.Po -rm -f ./$(DEPDIR)/sestest.Po -rm -f ./$(DEPDIR)/tcp.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)/config.Po -rm -f ./$(DEPDIR)/dis.Po -rm -f ./$(DEPDIR)/sesadmin.Po -rm -f ./$(DEPDIR)/sesrun.Po -rm -f ./$(DEPDIR)/sestest.Po -rm -f ./$(DEPDIR)/tcp.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: xrdp-0.9.12/sesman/tools/sesrun.c000644 001751 001751 00000007375 13544635323 016635 0ustar00metameta000000 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 "sesman.h" #include "tcp.h" struct config_sesman g_cfg; /* config.h */ /******************************************************************************/ int main(int argc, char **argv) { int sck; int code; int i; int size; int version; int width; int height; int bpp; int display; int session_code; struct stream *in_s; struct stream *out_s; char *username; char *password; long data; if (0 != config_read(&g_cfg)) { g_printf("sesrun: error reading config. quitting.\n"); return 1; } if (argc == 1) { g_printf("xrdp session starter v0.1\n"); g_printf("\nusage:\n"); g_printf("sesrun \n"); g_printf("session code 0 for Xvnc, 10 for X11RDP, 20 for Xorg\n"); } else if (argc == 8) { username = argv[2]; password = argv[3]; width = g_atoi(argv[4]); height = g_atoi(argv[5]); bpp = g_atoi(argv[6]); session_code = g_atoi(argv[7]); make_stream(in_s); init_stream(in_s, 8192); make_stream(out_s); init_stream(out_s, 8192); sck = g_tcp_socket(); if (sck < 0) return 1; if (g_tcp_connect(sck, argv[1], g_cfg.listen_port) == 0) { s_push_layer(out_s, channel_hdr, 8); out_uint16_be(out_s, session_code); /* code */ i = g_strlen(username); out_uint16_be(out_s, i); out_uint8a(out_s, username, i); i = g_strlen(password); out_uint16_be(out_s, i); out_uint8a(out_s, password, i); out_uint16_be(out_s, width); out_uint16_be(out_s, height); out_uint16_be(out_s, bpp); s_mark_end(out_s); s_pop_layer(out_s, channel_hdr); out_uint32_be(out_s, 0); /* version */ out_uint32_be(out_s, out_s->end - out_s->data); /* size */ tcp_force_send(sck, out_s->data, out_s->end - out_s->data); if (tcp_force_recv(sck, in_s->data, 8) == 0) { in_uint32_be(in_s, version); in_uint32_be(in_s, size); init_stream(in_s, 8192); if (tcp_force_recv(sck, in_s->data, size - 8) == 0) { if (version == 0) { in_uint16_be(in_s, code); if (code == 3) { in_uint16_be(in_s, data); in_uint16_be(in_s, display); g_printf("ok %d display %d\n", (int)data, display); } } } } } else { g_printf("connect error\n"); } g_tcp_close(sck); free_stream(in_s); free_stream(out_s); } return 0; } xrdp-0.9.12/sesman/tools/dis.c000644 001751 001751 00000003620 13544635323 016062 0ustar00metameta000000 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" int main(int argc, char **argv) { int sck; int dis; struct sockaddr_un sa; size_t len; char *p; 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 = strtol(display + 1, &p, 10); memset(&sa, 0, sizeof(sa)); sa.sun_family = AF_UNIX; sprintf(sa.sun_path, XRDP_DISCONNECT_STR, 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.9.12/sesman/tools/sestest.c000644 001751 001751 00000015424 13544635323 017002 0ustar00metameta000000 000000 /* * sestest.c - an scp_v1 testing 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 "tcp.h" #include "libscp.h" #include "parse.h" #include "log.h" #include int inputSession(struct SCP_SESSION *s); unsigned int menuSelect(unsigned int choices); int main(int argc, char **argv) { char buf[256]; struct SCP_SESSION *s; struct SCP_CONNECTION *c; /*struct SCP_DISCONNECTED_SESSION ds;*/ struct SCP_DISCONNECTED_SESSION *dsl; enum SCP_CLIENT_STATES_E e; struct log_config log; int end; int scnt; int idx; int sel; int sock; log.enable_syslog = 0; log.log_level = LOG_LEVEL_DEBUG; log.program_name = "sestest"; log.log_file = g_strdup("sestest.log"); log_start_from_param(&log); scp_init(); sock = g_tcp_socket(); if (sock < 0) return 1; s = scp_session_create(); c = scp_connection_create(sock); if (0 != g_tcp_connect(sock, "localhost", "3350")) { g_printf("error connecting"); return 1; } g_printf("001 - send connect request\n"); scp_session_set_type(s, SCP_SESSION_TYPE_XVNC); scp_session_set_version(s, 1); scp_session_set_height(s, 600); scp_session_set_width(s, 800); scp_session_set_bpp(s, 16); scp_session_set_rsr(s, 0); scp_session_set_locale(s, "it_IT"); scp_session_set_username(s, "prog"); scp_session_set_password(s, "prog"); scp_session_set_hostname(s, "odin"); // scp_session_set_addr(s, SCP_ADDRESS_TYPE_IPV4, "127.0.0.1"); // scp_session_set_display(struct SCP_SESSION* s, SCP_DISPLAY display); // scp_session_set_errstr(struct SCP_SESSION* s, char* str); /*s.type=SCP_SESSION_TYPE_XVNC; s.version=1; s.height=600; s.width=800; s.bpp=8; s.rsr=0; g_strncpy(s.locale,"it_IT 0123456789",18); s.username=g_malloc(256, 1); g_strncpy(s.username,"prog",255); s.password=g_malloc(256,1); g_strncpy(s.password, "prog", 255); g_printf("%s - %s\n", s.username, s.password); s.hostname=g_malloc(256,1); g_strncpy(s.hostname, "odin", 255); s.addr_type=SCP_ADDRESS_TYPE_IPV4; s.ipv4addr=0; s.errstr=0;*/ end = 0; e = scp_v1c_connect(c, s); while (!end) { switch (e) { case SCP_CLIENT_STATE_OK: g_printf("OK : display is %d\n", (short int)s->display); end = 1; break; case SCP_CLIENT_STATE_SESSION_LIST: g_printf("OK : session list needed\n"); e = scp_v1c_get_session_list(c, &scnt, &dsl); break; case SCP_CLIENT_STATE_LIST_OK: g_printf("OK : selecting a session:\n"); for (idx = 0; idx < scnt; idx++) { printf("Session \t%d - %d - %dx%dx%d - %d %d %d - %4d/%2d/%2d@%2d:%2d\n", \ (dsl[idx]).SID, (dsl[idx]).type, (dsl[idx]).width, (dsl[idx]).height, (dsl[idx]).bpp, \ (dsl[idx]).idle_days, (dsl[idx]).idle_hours, (dsl[idx]).idle_minutes, \ (dsl[idx]).conn_year, (dsl[idx]).conn_month, (dsl[idx]).conn_day, (dsl[idx]).conn_hour, (dsl[idx]).conn_minute); } sel = menuSelect(scnt); e = scp_v1c_select_session(c, s, dsl[sel - 1].SID); g_printf("\n return: %d \n", e); break; case SCP_CLIENT_STATE_RESEND_CREDENTIALS: g_printf("ERR: resend credentials - %s\n", s->errstr); g_printf(" username:"); if (scanf("%255s", buf) < 0) { g_writeln("error"); } scp_session_set_username(s, buf); g_printf(" password:"); if (scanf("%255s", buf) < 0) { g_writeln("error"); } scp_session_set_password(s, buf); e = scp_v1c_resend_credentials(c, s); break; case SCP_CLIENT_STATE_CONNECTION_DENIED: g_printf("ERR: connection denied: %s\n", s->errstr); end = 1; break; case SCP_CLIENT_STATE_PWD_CHANGE_REQ: g_printf("OK : password change required\n"); break; /*case SCP_CLIENT_STATE_RECONNECT_SINGLE: g_printf("OK : reconnect to 1 disconnected session\n"); e=scp_v1c_retrieve_session(&c, &s, &ds); g_printf("Session Type: %d on %d\n", ds.type, s.display); g_printf("Session Screen: %dx%dx%d\n", ds.height, ds.width, ds.bpp);*/ break; default: g_printf("protocol error: %d\n", e); end = 1; } } g_tcp_close(sock); scp_session_destroy(s); scp_connection_destroy(c); /*free_stream(c.in_s); free_stream(c.out_s);*/ return 0; } int inputSession(struct SCP_SESSION *s) { unsigned int integer; g_printf("username: "); if (scanf("%255s", s->username) < 0) { g_writeln("error"); } g_printf("password:"); if (scanf("%255s", s->password) < 0) { g_writeln("error"); } g_printf("hostname:"); if (scanf("%255s", s->hostname) < 0) { g_writeln("error"); } g_printf("session type:\n"); g_printf("%d: Xvnc\n", SCP_SESSION_TYPE_XVNC); g_printf("%d: x11rdp\n", SCP_SESSION_TYPE_XRDP); integer = menuSelect(1); if (integer == 1) { s->type = SCP_SESSION_TYPE_XRDP; } else { s->type = SCP_SESSION_TYPE_XVNC; } s->version = 1; s->height = 600; s->width = 800; s->bpp = 8; /* fixed for now */ s->rsr = 0; g_strncpy(s->locale, "it_IT 0123456789", 18); return 0; } tui32 menuSelect(tui32 choices) { tui32 sel; int ret; ret = scanf("%u", &sel); while ((ret == 0) || (sel > choices)) { g_printf("invalid choice."); ret = scanf("%u", &sel); } return sel; } xrdp-0.9.12/sesman/tools/tcp.c000644 001751 001751 00000006574 13544635323 016104 0ustar00metameta000000 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 tcp.c * @brief Tcp stream functions * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "sesman.h" #include #include #include #include #include /*****************************************************************************/ int tcp_force_recv(int sck, char *data, int len) { int rcvd; //#ifndef LIBSCP_CLIENT // int block; // block = lock_fork_critical_section_start(); //#endif while (len > 0) { rcvd = g_tcp_recv(sck, data, len, 0); if (rcvd == -1) { if (g_tcp_last_error_would_block(sck)) { g_sleep(1); } else { //#ifndef LIBSCP_CLIENT // lock_fork_critical_section_end(block); //#endif return 1; } } else if (rcvd == 0) { //#ifndef LIBSCP_CLIENT // lock_fork_critical_section_end(block); //#endif return 1; } else { data += rcvd; len -= rcvd; } } //#ifndef LIBSCP_CLIENT // lock_fork_critical_section_end(block); //#endif return 0; } /*****************************************************************************/ int tcp_force_send(int sck, char *data, int len) { int sent; //#ifndef LIBSCP_CLIENT // int block; // block = lock_fork_critical_section_start(); //#endif while (len > 0) { sent = g_tcp_send(sck, data, len, 0); if (sent == -1) { if (g_tcp_last_error_would_block(sck)) { g_sleep(1); } else { //#ifndef LIBSCP_CLIENT // lock_fork_critical_section_end(block); //#endif return 1; } } else if (sent == 0) { //#ifndef LIBSCP_CLIENT // lock_fork_critical_section_end(block); //#endif return 1; } else { data += sent; len -= sent; } } //#ifndef LIBSCP_CLIENT // lock_fork_critical_section_end(block); //#endif return 0; } /*****************************************************************************/ int tcp_bind(int sck, char *addr, char *port) { struct sockaddr_in s; memset(&s, 0, sizeof(struct sockaddr_in)); s.sin_family = AF_INET; s.sin_port = htons(atoi(port)); s.sin_addr.s_addr = inet_addr(addr); return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_in)); } xrdp-0.9.12/sesman/chansrv/ms-erref.h000644 001751 001751 00000002367 13601643631 017336 0ustar00metameta000000 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 { NT_STATUS_SUCCESS = 0x00000000, NT_STATUS_UNSUCCESSFUL = 0xC0000001, NT_STATUS_NO_SUCH_FILE = 0xC000000F, NT_STATUS_ACCESS_DENIED = 0xC0000022, NT_STATUS_OBJECT_NAME_INVALID = 0xC0000033, NT_STATUS_OBJECT_NAME_NOT_FOUND = 0xC0000034, NT_STATUS_SHARING_VIOLATION = 0xC0000043, NT_STATUS_NO_MORE_FILES = 0x80000006 }; #endif /* MS_ERREF_H */ xrdp-0.9.12/sesman/chansrv/smartcard_pcsc.h000644 001751 001751 00000007400 13544635323 020604 0ustar00metameta000000 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.9.12/sesman/chansrv/audin.h000644 001751 001751 00000001437 13544635323 016720 0ustar00metameta000000 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_ int audin_init(void); int audin_deinit(void); int audin_start(void); int audin_stop(void); #endif xrdp-0.9.12/sesman/chansrv/rail.c000644 001751 001751 00000173257 13544635323 016554 0ustar00metameta000000 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 "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(10, ("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(10, ("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(10, ("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_message(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_message(LOG_LEVEL_ERROR, "rail_init: RandR extension not found"); } if (g_xrr_event_base > 0) { LOG(0, ("rail_init: found RandR extension")); st = XRRQueryVersion(g_display, &ver_maj, &ver_min); if (st) { LOG(0, ("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, int num_chars) { twchar *rchrs; char *rv; int index; int lchars; rchrs = 0; rv = 0; if (num_chars > 0) { rchrs = (twchar *)g_malloc((num_chars + 1) * sizeof(twchar), 0); for (index = 0; index < num_chars; index++) { in_uint16_le(s, rchrs[index]); } rchrs[num_chars] = 0; lchars = g_wcstombs(0, rchrs, 0); if (lchars > 0) { rv = (char *)g_malloc((lchars + 1) * 4, 0); g_wcstombs(rv, rchrs, lchars); rv[lchars] = 0; } } g_free(rchrs); return rv; } /*****************************************************************************/ static int rail_process_exec(struct stream *s, int size) { int flags; int ExeOrFileLength; int WorkingDirLength; int ArgumentsLen; char *ExeOrFile; char *WorkingDir; char *Arguments; LOG(0, ("chansrv::rail_process_exec:")); in_uint16_le(s, flags); in_uint16_le(s, ExeOrFileLength); in_uint16_le(s, WorkingDirLength); in_uint16_le(s, ArgumentsLen); ExeOrFile = read_uni(s, ExeOrFileLength); WorkingDir = read_uni(s, WorkingDirLength); Arguments = read_uni(s, ArgumentsLen); LOG(10, (" flags 0x%8.8x ExeOrFileLength %d WorkingDirLength %d " "ArgumentsLen %d ExeOrFile [%s] WorkingDir [%s] " "Arguments [%s]", flags, ExeOrFileLength, WorkingDirLength, ArgumentsLen, ExeOrFile, WorkingDir, Arguments)); if (g_strlen(ExeOrFile) > 0) { rail_startup(); LOG(10, ("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(10, ("rail_process_exec: post")); } g_free(ExeOrFile); g_free(WorkingDir); g_free(Arguments); return 0; } /******************************************************************************/ 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(10, (" 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(0, ("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(10, ("my_timeout: g_got_focus %d", g_got_focus)); if (g_focus_counter == (int)(long)data) { LOG(10, ("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(10, ("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(10, ("chansrv::rail_process_activate: window 0x%8.8x not in list", window_id)); return 0; } g_focus_counter++; g_got_focus = enabled; LOG(10, (" 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(10, ("chansrv::rail_process_activate: calling XRaiseWindow 0x%8.8x", window_id)); XRaiseWindow(g_display, window_id); LOG(10, ("chansrv::rail_process_activate: calling XSetInputFocus 0x%8.8x", window_id)); XSetInputFocus(g_display, window_id, RevertToParent, CurrentTime); } LOG(10, ("chansrv::rail_process_activate: calling XRaiseWindow 0x%8.8x", window_id)); XRaiseWindow(g_display, window_id); LOG(10, ("chansrv::rail_process_activate: calling XSetInputFocus 0x%8.8x", window_id)); XSetInputFocus(g_display, window_id, RevertToParent, CurrentTime); } else { LOG(10, (" 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(10, ("chansrv::rail_process_system_param:")); in_uint32_le(s, system_param); LOG(10, (" 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(10, (" 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(10, (" 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(10, (" 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(10, (" 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(10, (" 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(10, ("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(10, ("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(10, ("chansrv::rail_process_activate: calling XRaiseWindow 0x%8.8x", window_id)); XRaiseWindow(g_display, window_id); LOG(10, ("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(10, ("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(10, ("chansrv::rail_process_system_command: window 0x%8.8x not in list", window_id)); return 0; } switch (command) { case SC_SIZE: LOG(10, (" window_id 0x%8.8x SC_SIZE", window_id)); break; case SC_MOVE: LOG(10, (" window_id 0x%8.8x SC_MOVE", window_id)); break; case SC_MINIMIZE: LOG(10, (" window_id 0x%8.8x SC_MINIMIZE", window_id)); rail_minmax_window(window_id, 0); break; case SC_MAXIMIZE: LOG(10, (" window_id 0x%8.8x SC_MAXIMIZE", window_id)); break; case SC_CLOSE: LOG(10, (" window_id 0x%8.8x SC_CLOSE", window_id)); rail_close_window(window_id); break; case SC_KEYMENU: LOG(10, (" window_id 0x%8.8x SC_KEYMENU", window_id)); break; case SC_RESTORE: LOG(10, (" window_id 0x%8.8x SC_RESTORE", window_id)); rail_restore_window(window_id); break; case SC_DEFAULT: LOG(10, (" window_id 0x%8.8x SC_DEFAULT", window_id)); break; default: LOG(10, (" 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(10, ("chansrv::rail_process_handshake:")); in_uint32_le(s, build_number); LOG(10, (" 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(10, ("chansrv::rail_process_notify_event:")); in_uint32_le(s, window_id); in_uint32_le(s, notify_id); in_uint32_le(s, message); LOG(10, (" 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(10, ("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(10, (" 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(10, ("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(10, (" 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(10, ("chansrv::rail_process_min_max_info:")); return 0; } /*****************************************************************************/ static int rail_process_client_status(struct stream *s, int size) { int flags; LOG(10, ("chansrv::rail_process_client_status:")); in_uint32_le(s, flags); LOG(10, (" 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(10, ("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(10, (" 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(10, ("chansrv::rail_process_lang_bar_info:")); in_uint32_le(s, language_bar_status); LOG(10, (" language_bar_status 0x%8.8x", language_bar_status)); return 0; } /*****************************************************************************/ static int rail_process_appid_req(struct stream *s, int size) { LOG(10, ("chansrv::rail_process_appid_req:")); return 0; } /*****************************************************************************/ static int rail_process_appid_resp(struct stream *s, int size) { LOG(10, ("chansrv::rail_process_appid_resp:")); return 0; } /*****************************************************************************/ /* server to client only */ static int rail_process_exec_result(struct stream *s, int size) { LOG(10, ("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(10, ("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(10, ("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(10, ("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(10, ("chansrv::rail_win_send_text: skipping, title not changed")); g_free(data); XFree(rwd); return 0; } } } } else { LOG(0, ("chansrv::rail_win_send_text: error rail_get_window_data_safe failed")); g_free(data); return 1; } if (data && len > 0) { LOG(10, ("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(10, ("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(10, ("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(10, ("chansrv::rail_create_window 0x%8.8lx", window_id)); rwd = rail_get_window_data_safe(window_id); if (rwd == 0) { LOG(0, ("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(10, (" 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(10, (" create new window")); flags = WINDOW_ORDER_TYPE_WINDOW | WINDOW_ORDER_STATE_NEW; list_add_item(g_window_list, window_id); } else { LOG(10, (" 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(10, (" 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(10, (" 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(10, ("chansrv::rail_configure_request_window: mask %d", mask)); if (mask & CWStackMode) { LOG(10, ("chansrv::rail_configure_request_window: CWStackMode " "detail 0x%8.8x above 0x%8.8lx", config->detail, config->above)); if (config->detail == Above) { LOG(10, ("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(10, ("chansrv::rail_configure_request_window: 0x%8.8x", window_id)); LOG(10, (" 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(0, ("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(10, ("chansrv::rail_configure_window 0x%8.8x", window_id)); LOG(10, (" 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(0, ("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(10, ("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(10, (" 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(10, (" 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(10, (" 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(10, (" 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(10, (" got MapRequest window 0x%8.8lx", lxevent->xmaprequest.window)); XMapWindow(g_display, lxevent->xmaprequest.window); break; case MapNotify: LOG(10, (" 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(10, (" 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(10, (" 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(10, (" 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(10, (" got FocusIn")); g_focus_win = lxevent->xfocus.window; break; case FocusOut: LOG(10, (" got FocusOut")); break; case ButtonPress: LOG(10, (" got ButtonPress")); break; case EnterNotify: LOG(10, (" got EnterNotify")); break; case LeaveNotify: LOG(10, (" got LeaveNotify")); break; case ReparentNotify: LOG(10, (" 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.9.12/sesman/chansrv/pcsc/000755 001751 001751 00000000000 13544635323 016372 5ustar00metameta000000 000000 xrdp-0.9.12/sesman/chansrv/devredir.c000644 001751 001751 00000221737 13601643631 017421 0ustar00metameta000000 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 "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" /* module based logging */ #define LOG_ERROR 0 #define LOG_INFO 1 #define LOG_DEBUG 2 #undef LOG_LEVEL #define LOG_LEVEL LOG_ERROR #define log_error(_params...) \ { \ g_write("[%10.10u]: DEV_REDIR %s: %d : ERROR: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } #define log_info(_params...) \ { \ if (LOG_INFO <= LOG_LEVEL) \ { \ g_write("[%10.10u]: DEV_REDIR %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } #define log_debug(_params...) \ { \ if (LOG_DEBUG <= LOG_LEVEL) \ { \ g_write("[%10.10u]: DEV_REDIR %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } /* 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 */ int g_is_printer_redir_supported = 0; int g_is_port_redir_supported = 0; int g_is_drive_redir_supported = 0; int g_is_smartcard_redir_supported = 0; int g_drive_redir_version = 1; char g_full_name_for_filesystem[1024]; 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 void devredir_proc_client_core_cap_resp(struct stream *s); static void devredir_proc_client_devlist_announce_req(struct stream *s); static void devredir_proc_client_devlist_remove_req(struct stream *s); static void devredir_proc_device_iocompletion(struct stream *s); static void 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 void devredir_cvt_to_unicode(char *unicode, const char *path); static void devredir_cvt_from_unicode_len(char *path, char *unicode, int len); static int devredir_string_ends_with(const char *string, char c); /*****************************************************************************/ int devredir_init(void) { struct stream *s; int bytes; int fd; union _u { tui32 clientID; char buf[4]; } u; /* get a random number that will act as a unique clientID */ if ((fd = open("/dev/urandom", O_RDONLY)) != -1) { if (read(fd, u.buf, 4) != 4) { } close(fd); } else { /* /dev/urandom did not work - use address of struct s */ tui64 u64 = (tui64) (tintptr) &s; u.clientID = (tui32) u64; } /* 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, u.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 permssions to Linux permissions. * * We can't curently 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; g_input_stream->p = g_input_stream->data; ls = g_input_stream; } /* read header from incoming data */ 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_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: 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; } // LK_TODO devredir_send_server_clientID_confirm(); break; case PAKID_CORE_CLIENT_NAME: /* client is telling us its computer name; do we even care? */ /* let client know login was successful */ devredir_send_server_user_logged_on(); usleep(1000 * 100); /* 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: devredir_proc_client_core_cap_resp(ls); break; case PAKID_CORE_DEVICELIST_ANNOUNCE: devredir_proc_client_devlist_announce_req(ls); break; case PAKID_CORE_DEVICELIST_REMOVE: devredir_proc_client_devlist_remove_req(ls); break; case PAKID_CORE_DEVICE_IOCOMPLETION: devredir_proc_device_iocompletion(ls); break; default: log_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_is_smartcard_redir_supported) { return scard_get_wait_objs(objs, count, timeout); } return 0; } /*****************************************************************************/ int devredir_check_wait_objs(void) { if (g_is_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) { 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, 0); /* ResultCode */ /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } /** * @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 len; tui32 SharedAccess; log_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); /* path in unicode needs this much space */ len = ((g_mbstowcs(NULL, path, 0) * sizeof(twchar)) / 2) + 2; xstream_new(s, 1024 + len); /* 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, len); /* PathLength */ devredir_cvt_to_unicode(s->p, path); /* path in unicode */ xstream_seek(s, len); /* 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_debug("sent close request; expect CID_FILE_CLOSE"); return 0; } /** * @brief ask client to enumerate directory * * Server Drive Query Directory Request * DR_DRIVE_QUERY_DIRECTORY_REQ * *****************************************************************************/ // LK_TODO Path needs to be Unicode static void devredir_send_drive_dir_request(IRP *irp, tui32 device_id, tui32 InitialQuery, char *Path) { struct stream *s; int bytes; char upath[4096]; // LK_TODO need to malloc this int path_len = 0; /* during Initial Query, Path cannot be NULL */ if (InitialQuery) { if (Path == NULL) { return; } /* Path in unicode needs this much space */ path_len = ((g_mbstowcs(NULL, Path, 0) * sizeof(twchar)) / 2) + 2; devredir_cvt_to_unicode(upath, Path); } xstream_new(s, 1024 + path_len); 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 */ if (!InitialQuery) { xstream_wr_u32_le(s, 0); /* PathLength */ xstream_seek(s, 23); } else { xstream_wr_u32_le(s, path_len); /* PathLength */ xstream_seek(s, 23); /* Padding */ xstream_wr_string(s, upath, path_len); } /* 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 ** ******************************************************************************/ /** * @brief process client's response to our core_capability_req() msg * * @param s stream containing client's response *****************************************************************************/ static void devredir_proc_client_core_cap_resp(struct stream *s) { int i; tui16 num_caps; tui16 cap_type; tui16 cap_len; tui32 cap_version; char* holdp; xstream_rd_u16_le(s, num_caps); xstream_seek(s, 2); /* padding */ for (i = 0; i < num_caps; i++) { holdp = s->p; xstream_rd_u16_le(s, cap_type); xstream_rd_u16_le(s, cap_len); xstream_rd_u32_le(s, cap_version); switch (cap_type) { case CAP_GENERAL_TYPE: log_debug("got CAP_GENERAL_TYPE"); break; case CAP_PRINTER_TYPE: log_debug("got CAP_PRINTER_TYPE"); g_is_printer_redir_supported = 1; break; case CAP_PORT_TYPE: log_debug("got CAP_PORT_TYPE"); g_is_port_redir_supported = 1; break; case CAP_DRIVE_TYPE: log_debug("got CAP_DRIVE_TYPE"); g_is_drive_redir_supported = 1; if (cap_version == 2) { g_drive_redir_version = 2; } break; case CAP_SMARTCARD_TYPE: log_debug("got CAP_SMARTCARD_TYPE"); g_is_smartcard_redir_supported = 1; scard_init(); break; } s->p = holdp + cap_len; } } static void 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]; /* get number of devices being announced */ xstream_rd_u32_le(s, device_count); log_debug("num of devices announced: %d", device_count); for (i = 0; i < device_count; i++) { xstream_rd_u32_le(s, device_type); xstream_rd_u32_le(s, g_device_id); switch (device_type) { case RDPDR_DTYP_FILESYSTEM: /* get preferred DOS name */ for (j = 0; j < 8; j++) { preferred_dos_name[j] = *s->p++; } /* DOS names that are 8 chars long are not NULL terminated */ preferred_dos_name[8] = 0; /* get device data len */ xstream_rd_u32_le(s, device_data_len); if (device_data_len) { xstream_rd_string(g_full_name_for_filesystem, s, device_data_len); } log_debug("device_type=FILE_SYSTEM device_id=0x%x dosname=%s " "device_data_len=%d full_name=%s", g_device_id, preferred_dos_name, device_data_len, g_full_name_for_filesystem); devredir_send_server_device_announce_resp(g_device_id); /* 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: /* get preferred DOS name */ for (j = 0; j < 8; j++) { preferred_dos_name[j] = *s->p++; } /* DOS names that are 8 chars long are not NULL terminated */ preferred_dos_name[8] = 0; /* for smart cards, device data len always 0 */ log_debug("device_type=SMARTCARD device_id=0x%x dosname=%s", g_device_id, preferred_dos_name); devredir_send_server_device_announce_resp(g_device_id); scard_device_announce(g_device_id); break; /* we don't yet support these devices */ case RDPDR_DTYP_SERIAL: case RDPDR_DTYP_PARALLEL: case RDPDR_DTYP_PRINT: log_debug("unsupported dev: 0x%x", device_type); break; } } } static void devredir_proc_client_devlist_remove_req(struct stream *s) { unsigned int i; tui32 device_count; tui32 device_id; /* get number of devices being announced */ xstream_rd_u32_le(s, device_count); log_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); } } } static void devredir_proc_device_iocompletion(struct stream *s) { IRP *irp = NULL; tui32 DeviceId; tui32 CompletionId; tui32 IoStatus32; tui32 Length; enum COMPLETION_TYPE comp_type; 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_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 == NT_STATUS_SUCCESS || IoStatus == NT_STATUS_NO_MORE_FILES || (IoStatus == NT_STATUS_NO_SUCH_FILE && comp_type == CID_LOOKUP)) { /* Successes or common occurrences - debug logging only */ log_debug("got %s", completion_type_to_str(comp_type)); } else { const char *pathname = (irp->pathname) ? irp->pathname : ""; log_error("CompletionType = %s, IoStatus=%08x " "Pathname = %s", completion_type_to_str(comp_type), IoStatus, pathname); } switch (comp_type) { case CID_CREATE_DIR_REQ: if (IoStatus != NT_STATUS_SUCCESS) { xfuse_devredir_cb_enum_dir_done( (struct state_dirscan *) irp->fuse_info, IoStatus); devredir_irp_delete(irp); } else { xstream_rd_u32_le(s, irp->FileId); devredir_send_drive_dir_request(irp, DeviceId, 1, irp->pathname); } break; case CID_CREATE_REQ: 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 != NT_STATUS_SUCCESS) { devredir_irp_delete(irp); } break; case CID_OPEN_REQ: xstream_rd_u32_le(s, irp->FileId); xfuse_devredir_cb_open_file((struct state_open *) irp->fuse_info, IoStatus, DeviceId, irp->FileId); if (IoStatus != NT_STATUS_SUCCESS) { devredir_irp_delete(irp); } break; case CID_READ: xstream_rd_u32_le(s, Length); xfuse_devredir_cb_read_file((struct state_read *) irp->fuse_info, s->p, Length); devredir_irp_delete(irp); break; case CID_WRITE: 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: devredir_proc_query_dir_response(irp, s, DeviceId, CompletionId, IoStatus); break; case CID_RMDIR_OR_FILE: 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: 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_error("got unknown CompletionID: DeviceId=0x%x " "CompletionId=0x%x IoStatus=0x%x", DeviceId, CompletionId, IoStatus); break; } } } static void devredir_proc_query_dir_response(IRP *irp, struct stream *s_in, tui32 DeviceId, tui32 CompletionId, enum NTSTATUS IoStatus) { tui32 Length; xstream_rd_u32_le(s_in, Length); if (IoStatus == NT_STATUS_SUCCESS) { unsigned int i; /* process FILE_DIRECTORY_INFORMATION structures */ for (i = 0 ; i < Length ; ++i) { char filename[256]; tui64 LastAccessTime; tui64 LastWriteTime; tui64 EndOfFile; tui32 FileAttributes; tui32 FileNameLength; struct file_attr fattr; xstream_seek(s_in, 4); /* 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); devredir_cvt_from_unicode_len(filename, s_in->p, FileNameLength); i += 64 + FileNameLength; //log_debug("LastAccessTime: 0x%llx", LastAccessTime); //log_debug("LastWriteTime: 0x%llx", LastWriteTime); //log_debug("EndOfFile: %lld", EndOfFile); //log_debug("FileAttributes: 0x%x", FileAttributes); //log_debug("FileNameLength: %d", FileNameLength); log_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); } /* Ask for more directory entries */ devredir_send_drive_dir_request(irp, DeviceId, 0, NULL); } else { if (IoStatus == NT_STATUS_NO_MORE_FILES) { IoStatus = NT_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); } } /** * 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_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_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_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_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_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_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_debug("creating dir"); CreateOptions = CO_FILE_DIRECTORY_FILE | CO_FILE_SYNCHRONOUS_IO_NONALERT; irp->gen.create.creating_dir = 1; } else { log_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_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_debug("open file in O_RDONLY"); DesiredAccess = DA_FILE_READ_DATA | DA_SYNCHRONIZE; break; case O_WRONLY: log_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_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_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_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 * * @return 0 on success, -1 on failure *****************************************************************************/ int 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; int rval = -1; 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_error("no IRP found with FileId = %d", FileId); xfuse_devredir_cb_read_file(fusep, 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, 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); rval = 0; } return rval; } int 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; int rval = -1; log_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_error("no IRP found with FileId = %d", FileId); xfuse_devredir_cb_write_file(fusep, NT_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, NT_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); rval = 0; } return rval; } 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_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 void devredir_cvt_to_unicode(char *unicode, const char *path) { char *dest; char *src; int rv; int i; rv = g_mbstowcs((twchar *) unicode, path, strlen(path)); /* unicode is typically 4 bytes, but microsoft only uses 2 bytes */ src = unicode + sizeof(twchar); /* skip 1st unicode char */ dest = unicode + 2; /* first char already in place */ for (i = 1; i < rv; i++) { *dest++ = *src++; *dest++ = *src++; src += 2; } *dest++ = 0; *dest++ = 0; } static void devredir_cvt_from_unicode_len(char *path, char *unicode, int len) { char *dest; char *dest_saved; char *src; int i; int bytes_to_alloc; int max_bytes; bytes_to_alloc = (((len / 2) * sizeof(twchar)) + sizeof(twchar)); src = unicode; dest = g_new0(char, bytes_to_alloc); dest_saved = dest; for (i = 0; i < len; i += 2) { *dest++ = *src++; *dest++ = *src++; dest += 2; } *dest++ = 0; *dest++ = 0; *dest++ = 0; *dest++ = 0; max_bytes = wcstombs(NULL, (wchar_t *) dest_saved, 0); if (max_bytes > 0) { wcstombs(path, (wchar_t *) dest_saved, max_bytes); path[max_bytes] = 0; } g_free(dest_saved); } 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 != NT_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 != NT_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); } static void devredir_proc_cid_rename_file(IRP *irp, enum NTSTATUS IoStatus) { struct stream *s; int bytes; int sblen; /* SetBuffer length */ int flen; /* FileNameLength */ if (IoStatus != NT_STATUS_SUCCESS) { log_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; } /* Path in unicode needs this much space */ flen = ((g_mbstowcs(NULL, irp->gen.rename.new_name, 0) * sizeof(twchar)) / 2) + 2; sblen = 6 + flen; xstream_new(s, 1024 + flen); 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, flen); /* FileNameLength */ /* filename in unicode */ devredir_cvt_to_unicode(s->p, irp->gen.rename.new_name); /* UNICODE_TODO */ xstream_seek(s, 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) { log_debug("entered"); xfuse_devredir_cb_rename_file((struct state_rename *)irp->fuse_info, IoStatus); if (IoStatus != NT_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_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_debug("LastAccessTime: 0x%llx", // (unsigned long long)LastAccessTime); //log_debug("LastWriteTime: 0x%llx", // (unsigned long long)LastWriteTime); //log_debug("ChangeTime: 0x%llx", // (unsigned long long)ChangeTime); //log_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_debug("processing FILE_STD_INFORMATION"); xstream_seek(s_in, 8); /* AllocationSize */ xstream_rd_u64_le(s_in, EndOfFile); //log_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 NT_STATUS_SUCCESS, the lookup has failed. *****************************************************************************/ static void lookup_done(IRP *irp, enum NTSTATUS IoStatus) { log_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_debug("entry state is %d",irp->gen.lookup.state); if (IoStatus != NT_STATUS_SUCCESS) { /* This is common to all setattr states */ log_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_error("Expected FILE_BASIC_INFORMATION length" "%d, got len=%d", FILE_BASIC_INFORMATION_SIZE, Length); IoStatus = NT_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_error("Expected FILE_STD_INFORMATION length" "%d, got len=%d", FILE_STD_INFORMATION_SIZE, Length); IoStatus = NT_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_debug("entry state is %d",irp->gen.setattr.state); if (IoStatus != NT_STATUS_SUCCESS) { /* This is common to all setattr states */ log_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_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_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.9.12/sesman/chansrv/Makefile.in000644 001751 001751 00000062471 13601646126 017516 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG @XRDP_FUSE_TRUE@am__append_2 = -DXRDP_FUSE $(FUSE_CFLAGS) @XRDP_FUSE_TRUE@am__append_3 = $(FUSE_LIBS) @XRDP_FDK_AAC_TRUE@am__append_4 = -DXRDP_FDK_AAC $(FDKAAC_CFLAGS) @XRDP_FDK_AAC_TRUE@am__append_5 = $(FDKAAC_LIBS) @XRDP_OPUS_TRUE@am__append_6 = -DXRDP_OPUS @XRDP_OPUS_TRUE@am__append_7 = -lopus @XRDP_MP3LAME_TRUE@am__append_8 = -DXRDP_MP3LAME @XRDP_MP3LAME_TRUE@am__append_9 = -lmp3lame @XRDP_RDPSNDAUDIN_TRUE@am__append_10 = -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_fuse.$(OBJEXT) chansrv_xfs.$(OBJEXT) \ clipboard.$(OBJEXT) clipboard_file.$(OBJEXT) \ devredir.$(OBJEXT) fifo.$(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 \ $(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_fuse.Po \ ./$(DEPDIR)/chansrv_xfs.Po ./$(DEPDIR)/clipboard.Po \ ./$(DEPDIR)/clipboard_file.Po ./$(DEPDIR)/devredir.Po \ ./$(DEPDIR)/fifo.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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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_PATH=\"${socketdir}\" -I$(top_srcdir)/common \ $(am__append_1) $(am__append_2) $(am__append_4) \ $(am__append_6) $(am__append_8) $(am__append_10) CHANSRV_EXTRA_LIBS = $(am__append_3) $(am__append_5) $(am__append_7) \ $(am__append_9) AM_CFLAGS = $(X_CFLAGS) xrdp_chansrv_SOURCES = \ chansrv.c \ chansrv.h \ chansrv_common.c \ chansrv_common.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 \ fifo.c \ fifo.h \ irp.c \ irp.h \ mlog.h \ ms-erref.h \ ms-fscc.h \ ms-rdpefs.h \ ms-smb2.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 \ $(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)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list 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_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)/fifo.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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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_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)/fifo.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_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)/fifo.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: xrdp-0.9.12/sesman/chansrv/xcommon.c000644 001751 001751 00000012371 13544635323 017272 0ustar00metameta000000 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" /* #undef LOG_LEVEL #define LOG_LEVEL 11 */ 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); LOGM((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(10, ("xcommon_init: xcommon_init already called")); return 0; } g_display = XOpenDisplay(0); if (g_display == 0) { LOGM((LOG_LEVEL_ERROR, "xcommon_init: error, XOpenDisplay failed")); return 1; } LOG(0, ("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) { LOGM((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(10, ("xcommon_check_wait_objs unknown xevent type %d", xevent.type)); } } return 0; } xrdp-0.9.12/sesman/chansrv/clipboard_common.h000644 001751 001751 00000010656 13544635323 021132 0ustar00metameta000000 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" #define CB_CAPSTYPE_GENERAL 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_USE_LONG_FORMAT_NAMES 0x00000002 #define CB_STREAM_FILECLIP_ENABLED 0x00000004 #define CB_FILECLIP_NO_FILE_PATHS 0x00000008 #define CB_CAN_LOCK_CLIPDATA 0x00000010 #define CB_FILECONTENTS_SIZE 0x00000001 #define CB_FILECONTENTS_RANGE 0x00000002 #define CB_FORMAT_RAW 0x0000 #define CB_FORMAT_TEXT 0x0001 #define CB_FORMAT_DIB 0x0008 #define CB_FORMAT_UNICODETEXT 0x000D #define CB_FORMAT_HTML 0xD010 #define CB_FORMAT_PNG 0xD011 #define CB_FORMAT_JPEG 0xD012 #define CB_FORMAT_GIF 0xD013 #define CB_FORMAT_FILE 0xC0BC /* Used by the Format List Response PDU, Format Data Response PDU, and File Contents Response PDU to indicate that the associated request Format List PDU, Format Data Request PDU, and File Contents Request PDU were processed successfully. */ #define CB_RESPONSE_OK 0x0001 /* Used by the Format List Response PDU, Format Data Response PDU, and File Contents Response PDU to indicate that the associated Format List PDU, Format Data Request PDU, and File Contents Request PDU were not processed successfully. */ #define CB_RESPONSE_FAIL 0x0002 /* Used by the Short Format Name variant of the Format List Response PDU to indicate the format names are in ASCII 8. */ #define CB_ASCII_NAMES 0x0004 /* these are the supported general types */ #define XRDP_CB_TEXT 1 #define XRDP_CB_BITMAP 2 #define XRDP_CB_FILE 3 #define CB_FD_ATTRIBUTES 0x00000004 #define CB_FD_FILESIZE 0x00000040 #define CB_FD_WRITESTIME 0x00000020 #define CB_FD_PROGRESSUI 0x00004000 #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 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 */ int doing_response_ss; /* doing response short circuit */ Time clip_time; }; struct clip_file_desc /* CLIPRDR_FILEDESCRIPTOR */ { tui32 flags; tui32 fileAttributes; tui32 lastWriteTimeLow; tui32 lastWriteTimeHigh; tui32 fileSizeHigh; tui32 fileSizeLow; char cFileName[256]; }; int clipboard_out_unicode(struct stream *s, const char *text, int num_chars); int clipboard_in_unicode(struct stream *s, char *text, int *num_chars); #endif xrdp-0.9.12/sesman/chansrv/chansrv_xfs.c000644 001751 001751 00000065213 13601643631 020134 0ustar00metameta000000 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 "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; }; /* module based logging */ #define LOG_ERROR 0 #define LOG_INFO 1 #define LOG_DEBUG 2 #ifndef LOG_LEVEL #define LOG_LEVEL LOG_ERROR #endif #define log_error(_params...) \ { \ g_write("[%10.10u]: XFS %s: %d : ERROR: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } #define log_always(_params...) \ { \ g_write("[%10.10u]: XFS %s: %d : ALWAYS: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } #define log_info(_params...) \ { \ if (LOG_INFO <= LOG_LEVEL) \ { \ g_write("[%10.10u]: XFS %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } #define log_debug(_params...) \ { \ if (LOG_DEBUG <= LOG_LEVEL) \ { \ g_write("[%10.10u]: XFS %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } /* ------------------------------------------------------------------------ */ 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; if (!grow_xfs(xfs, INODE_TABLE_ALLOCATION_INITIAL) || (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.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.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 && 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_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.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->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->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 direcory 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_entries_with_device_id(struct xfs_fs *xfs, tui32 device_id) { fuse_ino_t inum; XFS_INODE_ALL *xino; if (device_id != 0) { /* 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.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.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.9.12/sesman/chansrv/chansrv_common.h000644 001751 001751 00000001554 13544635323 020634 0ustar00metameta000000 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" int read_entire_packet(struct stream *src, struct stream **dest, int chan_flags, int length, int total_length); #endif xrdp-0.9.12/sesman/chansrv/Makefile.am000644 001751 001751 00000003150 13601643631 017470 0ustar00metameta000000 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_PATH=\"${socketdir}\" \ -I$(top_srcdir)/common if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif CHANSRV_EXTRA_LIBS = if XRDP_FUSE AM_CPPFLAGS += -DXRDP_FUSE $(FUSE_CFLAGS) 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_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 \ fifo.c \ fifo.h \ irp.c \ irp.h \ mlog.h \ ms-erref.h \ ms-fscc.h \ ms-rdpefs.h \ ms-smb2.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 \ $(X_PRE_LIBS) -lXfixes -lXrandr -lX11 $(X_EXTRA_LIBS) \ $(CHANSRV_EXTRA_LIBS) xrdp-0.9.12/sesman/chansrv/fifo.h000644 001751 001751 00000002033 13544635323 016534 0ustar00metameta000000 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. */ /* FIFO implementation to store a pointer to a user struct */ typedef struct fifo { long* user_data; int rd_ptr; int wr_ptr; int entries; } FIFO; int fifo_init(FIFO* fp, int num_entries); int fifo_deinit(FIFO* fp); int fifo_is_empty(FIFO* fp); int fifo_insert(FIFO* fp, void* data); void* fifo_remove(FIFO* fp); void* fifo_peek(FIFO* fp); xrdp-0.9.12/sesman/chansrv/irp.h000644 001751 001751 00000007504 13601643631 016406 0ustar00metameta000000 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 sufficent 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.9.12/sesman/chansrv/smartcard.c000644 001751 001751 00000224520 13601643631 017566 0ustar00metameta000000 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. * */ /* * smartcard redirection support */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "os_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 */ /* module based logging */ #define LOG_ERROR 0 #define LOG_INFO 1 #define LOG_DEBUG 2 #undef LOG_LEVEL #define LOG_LEVEL LOG_INFO #define log_error(_params...) \ do \ { \ g_write("[%10.10u]: SMART_CARD %s: %d : ERROR: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } while (0) #define log_info(_params...) \ do \ { \ if (LOG_INFO <= LOG_LEVEL) \ { \ g_write("[%10.10u]: SMART_CARD %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } while (0) #define log_debug(_params...) \ do \ { \ if (LOG_DEBUG <= LOG_LEVEL) \ if (2 <= 1) \ { \ g_write("[%10.10u]: SMART_CARD %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } while (0) /* [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_debug("entered: device_id=%d", device_id); if (g_smartcards_inited) { log_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_debug("scard_add_new_device failed with DeviceId=%d", g_device_id); else log_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(0, ("scard_init:")); return scard_pcsc_init(); } /** * *****************************************************************************/ int scard_deinit(void) { LOG(0, ("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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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 ** ** ** ******************************************************************************/ /** * Crate 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_error("scard_get_free_slot failed"); return -1; } sc = g_new0(SMARTCARD, 1); if (sc == NULL) { log_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_debug("found free slot at index %d", i); return i; } } log_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_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_error("smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_RELEASE_CONTEXT)) == NULL) { log_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_error("smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_IS_VALID_CONTEXT)) == NULL) { log_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 scard_send_ListReaders(IRP *irp, char *context, int context_bytes, char *groups, int cchReaders, int wide) { /* see [MS-RDPESC] 2.2.2.4 */ SMARTCARD *sc; struct stream *s; int bytes; int bytes_groups; int val; int index; int num_chars; tui32 ioctl; twchar w_groups[100]; if ((sc = smartcards[irp->scard_index]) == NULL) { log_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_error("scard_make_new_ioctl failed"); return; } num_chars = 0; bytes_groups = 0; w_groups[0] = 0; val = 0; if (groups != 0) { if (groups[0] != 0) { num_chars = g_mbstowcs(w_groups, groups, 99); bytes_groups = wide ? (num_chars + 2) * 2 : num_chars + 2; val = 0x00020004; } } 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, bytes_groups); out_uint32_le(s, val); out_uint32_le(s, 0x00000000); out_uint32_le(s, cchReaders); /* insert context */ out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); if (bytes_groups > 0) { if (wide) { out_uint32_le(s, bytes_groups); for (index = 0; index < num_chars; index++) { out_uint16_le(s, w_groups[index]); } out_uint16_le(s, 0); out_uint16_le(s, 0); } else { out_uint32_le(s, bytes_groups); for (index = 0; index < num_chars; index++) { out_uint8(s, w_groups[index]); } out_uint16_le(s, 0); out_uint16_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); #if 0 g_writeln("scard_send_ListReaders:"); g_hexdump(s->data, bytes); #endif free_stream(s); } /*****************************************************************************/ static int align_s(struct stream *s, int bytes) { int i32; i32 = (int) (s->p - s->data); while ((i32 % bytes) != 0) { out_uint8s(s, 1); i32 = (int) (s->p - s->data); } return 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 */ SMARTCARD *sc; READER_STATE *rs; struct stream *s; tui32 ioctl; int bytes; unsigned int i; int num_chars; int index; twchar w_reader_name[100]; if ((sc = smartcards[irp->scard_index]) == NULL) { log_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_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, timeout); out_uint32_le(s, num_readers); out_uint32_le(s, 0x00020004); /* ? */ /* insert context */ out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); out_uint32_le(s, num_readers); /* insert card reader state */ for (i = 0; i < num_readers; i++) { rs = &rsa[i]; out_uint32_le(s, 0x00020008); /* ? */ out_uint32_le(s, rs->current_state); out_uint32_le(s, rs->event_state); out_uint32_le(s, rs->atr_len); out_uint8p(s, rs->atr, 33); out_uint8s(s, 3); } if (wide) { /* insert card reader names */ for (i = 0; i < num_readers; i++) { rs = &rsa[i]; num_chars = g_mbstowcs(w_reader_name, rs->reader_name, 99); out_uint32_le(s, num_chars + 2); out_uint32_le(s, 0); out_uint32_le(s, num_chars + 2); for (index = 0; index < num_chars; index++) { out_uint16_le(s, w_reader_name[index]); } out_uint16_le(s, 0); out_uint16_le(s, 0); align_s(s, 4); } } else { /* insert card reader names */ for (i = 0; i < num_readers; i++) { rs = &rsa[i]; num_chars = g_mbstowcs(w_reader_name, rs->reader_name, 99); out_uint32_le(s, num_chars + 2); out_uint32_le(s, 0); out_uint32_le(s, num_chars + 2); for (index = 0; index < num_chars; index++) { out_uint8(s, w_reader_name[index]); } out_uint8(s, 0); out_uint8(s, 0); align_s(s, 4); } } 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); #if 0 g_writeln("scard_send_GetStatusChange:"); g_hexdump(s->data, bytes); #endif 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 */ SMARTCARD* sc; struct stream* s; tui32 ioctl; int bytes; int num_chars; int index; twchar w_reader_name[100]; if ((sc = smartcards[irp->scard_index]) == NULL) { log_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_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, 0x00020000); out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020004); out_uint32_le(s, rs->dwShareMode); out_uint32_le(s, rs->dwPreferredProtocols); num_chars = g_mbstowcs(w_reader_name, rs->reader_name, 99); out_uint32_le(s, num_chars + 2); out_uint32_le(s, 0x00000000); out_uint32_le(s, num_chars + 2); if (wide) { for (index = 0; index < num_chars; index++) { out_uint16_le(s, w_reader_name[index]); } out_uint16_le(s, 0); out_uint16_le(s, 0); } else { for (index = 0; index < num_chars; index++) { out_uint8(s, w_reader_name[index]); } out_uint8(s, 0); out_uint8(s, 0); } align_s(s, 4); /* insert context */ 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_error("smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_RECONNECT)) == NULL) { log_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_error("smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_BEGIN_TRANSACTION)) == NULL) { log_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_error("smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_END_TRANSACTION)) == NULL) { log_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_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_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); //g_hexdump(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_error("smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_DISCONNECT)) == NULL) { log_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_error("smartcards[%d] is NULL", irp->scard_index); return 1; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_TRANSMIT)) == NULL) { log_error("scard_make_new_ioctl"); return 1; } log_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); #if 0 g_writeln("scard_send_Transmit:"); g_hexdump(s->data, bytes); #endif 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_error("smartcards[%d] is NULL", irp->scard_index); return 1; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_CONTROL)) == NULL) { log_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); //g_hexdump(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_error("smartcards[%d] is NULL", irp->scard_index); return 1; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_CANCEL)) == NULL) { log_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_error("smartcards[%d] is NULL", irp->scard_index); return 1; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_GETATTRIB)) == NULL) { log_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_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_ReleaseContext_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_IsContextValid_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_ListReaders_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_GetStatusChange_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_Connect_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_Reconnect_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_BeginTransaction_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_EndTransaction_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_Status_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_Disconnect_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_Transmit_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_Control_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId,tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_Cancel_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } /** * *****************************************************************************/ static void scard_handle_GetAttrib_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; log_debug("entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { log_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_debug("leaving"); } xrdp-0.9.12/sesman/chansrv/chansrv.h000644 001751 001751 00000005451 13544635323 017264 0ustar00metameta000000 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); #define LOG_LEVEL 5 #define LOG(_a, _params) \ { \ if (_a < LOG_LEVEL) \ { \ g_write("xrdp-chansrv [%10.10u]: ", g_time3()); \ g_writeln _params ; \ } \ } #define LOGM(_args) do { log_message _args ; } while (0) #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.9.12/sesman/chansrv/clipboard_file.c000644 001751 001751 00000050500 13544635323 020544 0ustar00metameta000000 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 "list.h" #include "chansrv.h" #include "clipboard.h" #include "clipboard_file.h" #include "clipboard_common.h" #include "xcommon.h" #include "chansrv_fuse.h" /* module based logging */ #define LOG_ERROR 0 #define LOG_INFO 1 #define LOG_DEBUG 2 #define LOG_LVL LOG_ERROR #define log_error(_params...) \ { \ g_write("[%10.10u]: CLIPFILE %s: %d : ERROR: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } #define log_always(_params...) \ { \ g_write("[%10.10u]: CLIPFILE %s: %d : ALWAYS: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } #define log_info(_params...) \ { \ if (LOG_INFO <= LOG_LVL) \ { \ g_write("[%10.10u]: CLIPFILE %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } #define log_debug(_params...) \ { \ if (LOG_DEBUG <= LOG_LVL) \ { \ g_write("[%10.10u]: CLIPFILE %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } 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 /*****************************************************************************/ /* 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_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); if (g_directory_exist(full_fn)) { log_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_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_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; char fn[256]; struct cb_file_info *cfi; log_debug("clipboard_send_data_response_for_file: data_size %d", data_size); //g_hexdump(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); g_snprintf(fn, 255, "%s", cfi->filename); clipboard_out_unicode(s, fn, 256); out_uint8s(s, 8); /* pad */ } 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_error("clipboard_send_file_size: error g_files_list is nil"); return 1; } cfi = (struct cb_file_info *)list_get_item(g_files_list, lindex); if (cfi == 0) { log_error("clipboard_send_file_size: error cfi is nil"); return 1; } file_size = cfi->size; log_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_debug("clipboard_request_file_size:"); if (g_file_request_sent_type != 0) { log_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_error("clipboard_send_file_data: error g_files_list is nil"); return 1; } cfi = (struct cb_file_info *)list_get_item(g_files_list, lindex); if (cfi == 0) { log_error("clipboard_send_file_data: error cfi is nil"); return 1; } log_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_ex(full_fn, 1, 0, 0, 0); if (fd == -1) { log_error("clipboard_send_file_data: file open [%s] failed", full_fn); return 1; } if (g_file_seek(fd, nPositionLow) < 0) { log_message(LOG_LEVEL_ERROR, "clipboard_send_file_data: seek error " "in file: %s", full_fn); g_file_close(fd); return 1; } make_stream(s); init_stream(s, cbRequested + 64); size = g_file_read(fd, s->data + 12, cbRequested); if (size < 1) { log_error("clipboard_send_file_data: read error, want %d got %d", cbRequested, size); free_stream(s); g_file_close(fd); 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); 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_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_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_debug("clipboard_process_file_request:"); //g_hexdump(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_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_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_error("clipboard_process_file_response: error"); g_file_request_sent_type = 0; } return 0; } /*****************************************************************************/ /* read in CLIPRDR_FILEDESCRIPTOR */ static int clipboard_c2s_in_file_info(struct stream *s, struct clip_file_desc *cfd) { int num_chars; int ex_bytes; 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); num_chars = 256; clipboard_in_unicode(s, cfd->cFileName, &num_chars); ex_bytes = 512 - num_chars * 2; ex_bytes -= 2; in_uint8s(s, ex_bytes); in_uint8s(s, 8); /* pad */ log_debug("clipboard_c2s_in_file_info:"); log_debug(" flags 0x%8.8x", cfd->flags); log_debug(" fileAttributes 0x%8.8x", cfd->fileAttributes); log_debug(" lastWriteTime 0x%8.8x%8.8x", cfd->lastWriteTimeHigh, cfd->lastWriteTimeLow); log_debug(" fileSize 0x%8.8x%8.8x", cfd->fileSizeHigh, cfd->fileSizeLow); log_debug(" num_chars %d cFileName [%s]", num_chars, cfd->cFileName); return 0; } /*****************************************************************************/ int clipboard_c2s_in_files(struct stream *s, char *file_list) { int cItems; int lindex; int str_len; int file_count; struct clip_file_desc *cfd; char *ptr; if (!s_check_rem(s, 4)) { log_error("clipboard_c2s_in_files: parse error"); return 1; } in_uint32_le(s, cItems); if (cItems > 64 * 1024) /* sanity check */ { log_error("clipboard_c2s_in_files: error cItems %d too big", cItems); return 1; } xfuse_clear_clip_dir(); log_debug("clipboard_c2s_in_files: cItems %d", cItems); cfd = (struct clip_file_desc *) g_malloc(sizeof(struct clip_file_desc), 0); file_count = 0; ptr = file_list; for (lindex = 0; lindex < cItems; lindex++) { g_memset(cfd, 0, sizeof(struct clip_file_desc)); clipboard_c2s_in_file_info(s, cfd); if ((g_pos(cfd->cFileName, "\\") >= 0) || (cfd->fileAttributes & CB_FILE_ATTRIBUTE_DIRECTORY)) { log_error("clipboard_c2s_in_files: skipping directory not " "supported [%s]", cfd->cFileName); continue; } if (xfuse_add_clip_dir_item(cfd->cFileName, 0, cfd->fileSizeLow, lindex) == -1) { log_error("clipboard_c2s_in_files: failed to add clip dir item"); continue; } if (file_count > 0) { *ptr = '\n'; ptr++; } file_count++; g_strcpy(ptr, "file://"); ptr += 7; str_len = g_strlen(g_fuse_clipboard_path); g_strcpy(ptr, g_fuse_clipboard_path); ptr += str_len; *ptr = '/'; ptr++; str_len = g_strlen(cfd->cFileName); g_strcpy(ptr, cfd->cFileName); ptr += str_len; } *ptr = 0; g_free(cfd); return 0; } xrdp-0.9.12/sesman/chansrv/clipboard.h000644 001751 001751 00000001723 13544635323 017555 0ustar00metameta000000 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.9.12/sesman/chansrv/chansrv_fuse.h000644 001751 001751 00000010074 13601643631 020276 0ustar00metameta000000 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, 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); #endif xrdp-0.9.12/sesman/chansrv/sound.c000644 001751 001751 00000146205 13601643631 016741 0ustar00metameta000000 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 "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 */ /* 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; 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(10, ("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(1, ("sound_process_output_format:")); LOG(1, (" wFormatTag %d", wFormatTag)); LOG(1, (" nChannels %d", nChannels)); LOG(1, (" nSamplesPerSec %d", nSamplesPerSec)); LOG(1, (" nAvgBytesPerSec %d", nAvgBytesPerSec)); LOG(1, (" nBlockAlign %d", nBlockAlign)); LOG(1, (" wBitsPerSample %d", wBitsPerSample)); LOG(1, (" cbSize %d", cbSize)); g_hexdump(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(0, ("wFormatTag, fdk aac")); g_client_does_fdk_aac = 1; g_client_fdk_aac_index = aindex; break; case WAVE_FORMAT_MPEGLAYER3: LOG(0, ("wFormatTag, mp3")); g_client_does_mp3lame = 1; g_client_mp3lame_index = aindex; break; case WAVE_FORMAT_OPUS: LOG(0, ("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(0, ("sound_wave_compress_fdk_aac: using fdk aac")); error = aacEncOpen(&g_fdk_aac_encoder, 0, 2); if (error != AACENC_OK) { LOG(0, ("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(0, ("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(0, ("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(0, ("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(0, ("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(0, ("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(0, ("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(0, ("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(0, ("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(0, ("sound_wave_compress_fdk_aac: aacEncInfo failed")); } LOG(0, ("sound_wave_compress_fdk_aac:")); LOG(0, (" AACENC_InfoStruct")); LOG(0, (" maxOutBufBytes %d", info.maxOutBufBytes)); LOG(0, (" maxAncBytes %d", info.maxAncBytes)); LOG(0, (" inBufFillLevel %d", info.inBufFillLevel)); LOG(0, (" inputChannels %d", info.inputChannels)); LOG(0, (" frameLength %d", info.frameLength)); #if AACENCODER_LIB_VER_GTEQ(4, 0, 0) LOG(0, (" nDelay %d", info.nDelay)); LOG(0, (" nDelayCore %d", info.nDelayCore)); #else LOG(0, (" encoderDelay %d", info.encoderDelay)); #endif LOG(0, (" confBuf")); LOG(0, (" 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(10, ("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(0, ("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(0, ("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(0, ("sound_wave_compress_mp3lame: using mp3lame")); g_lame_encoder = lame_init(); if (g_lame_encoder == 0) { LOG(0, ("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); if (lame_init_params(g_lame_encoder) == -1) { LOG(0, ("sound_wave_compress_mp3lame: lame_init_params() failed")); return rv; } LOG(0, ("sound_wave_compress_mp3lame: lame config:")); LOG(0, (" brate : %d", lame_get_brate(g_lame_encoder))); LOG(0, (" compression ratio: %f", lame_get_compression_ratio(g_lame_encoder))); LOG(0, (" encoder delay : %d", lame_get_encoder_delay(g_lame_encoder))); LOG(0, (" frame size : %d", lame_get_framesize(g_lame_encoder))); LOG(0, (" encoder padding : %d", lame_get_encoder_padding(g_lame_encoder))); LOG(0, (" 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(0, ("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(10, ("sound_send_wave_data_chunk: data_bytes %d", data_bytes)); if ((data_bytes < 4) || (data_bytes > 128 * 1024)) { LOG(0, ("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); /* part one of 2 PDU wave info */ LOG(10, ("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(10, ("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(10, ("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(10, ("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(0, ("sound_send_wave_data: dropped, no room")); break; } else if (res != 0) { LOG(10, ("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(10, ("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(0, ("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(10, ("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) { switch (id) { case 0: return sound_send_wave_data(s->p, size); break; case 1: return sound_send_close(); break; default: LOG(10, ("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(0, ("sound_sndsrvr_sink_data_in: bad message id %d size %d", id, size)); return 1; } LOG(10, ("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(0, ("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(0, ("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; } /*****************************************************************************/ int sound_init(void) { LOG(0, ("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 */ fifo_init(&g_in_fifo, 100); 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); return 0; } /*****************************************************************************/ int sound_deinit(void) { LOG(10, ("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_deinit(&g_in_fifo); 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(10, ("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(10, ("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(10, ("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(10, ("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(10, ("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(10, ("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(10, ("sound_process_input_format:")); LOG(10, (" wFormatTag %d", wFormatTag)); LOG(10, (" nChannels %d", nChannels)); LOG(10, (" nSamplesPerSec %d", nSamplesPerSec)); LOG(10, (" nAvgBytesPerSec %d", nAvgBytesPerSec)); LOG(10, (" nBlockAlign %d", nBlockAlign)); LOG(10, (" wBitsPerSample %d", wBitsPerSample)); LOG(10, (" 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(10, ("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(10, ("sound_input_start_recording:")); /* if there is any data in FIFO, discard it */ while ((s = (struct stream *) fifo_remove(&g_in_fifo)) != NULL) { xstream_free(s); } 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(10, ("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(10, ("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_insert(&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_message(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(10, ("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(&g_in_fifo); if (g_stream_inp != NULL) { g_bytes_in_fifo -= g_stream_inp->size; LOG(10, (" 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[1024]; 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, 255, CHANSRV_PORT_IN_STR, 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(0, ("trans_listen failed")); return 0; } /** * Start a listener for speaker redirection connections *****************************************************************************/ static int sound_start_sink_listener(void) { char port[1024]; 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, 255, CHANSRV_PORT_OUT_STR, 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(0, ("trans_listen failed")); return 0; } xrdp-0.9.12/sesman/chansrv/chansrv_xfs.h000644 001751 001751 00000022075 13601643631 020140 0ustar00metameta000000 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 */ tui32 device_id; /* for file system redirection * Non-redirected devices are guaranteed * to have a device_id or zero */ 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 entries with the matching device id * * Files are deleted even if they are open * * The specified device_id must be non-zero so that the root * filesystem is not deleted! * * @param device_id Device ID */ void xfs_delete_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.9.12/sesman/chansrv/wave-format-server.txt000644 001751 001751 00000140405 13544635323 021743 0ustar00metameta000000 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.9.12/sesman/chansrv/xcommon.h000644 001751 001751 00000002140 13544635323 017270 0ustar00metameta000000 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.9.12/sesman/chansrv/audin.c000644 001751 001751 00000033520 13544635323 016711 0ustar00metameta000000 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 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 */ /*****************************************************************************/ 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(0, ("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(0, ("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(0, ("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; LOG(0, ("audin_send_open:")); make_stream(s); init_stream(s, 8192); out_uint8(s, MSG_SNDIN_OPEN); out_uint32_le(s, 2048); /* FramesPerPacket */ out_uint32_le(s, g_current_format); /* initialFormat */ wf = g_client_formats[g_current_format]; 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(0, ("audin_process_version:")); if (!s_check_rem(s, 4)) { LOG(0, ("audin_process_version: parse error")); return 1; } in_uint32_le(s, version); LOG(0, ("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(0, ("audin_process_formats:")); cleanup_client_formats(); if (!s_check_rem(s, 8)) { LOG(0, ("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(0, ("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(0, ("audin_process_formats: recved format wFormatTag 0x%4.4x " "nChannels %d nSamplesPerSec %d", wf->wFormatTag, wf->nChannels, wf->nSamplesPerSec)); if (wf->cbSize > 0) { if (!s_check_rem(s, wf->cbSize)) { LOG(0, ("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(0, ("audin_process_open_reply: parse error")); return 1; } in_uint32_le(s, result); LOG(0, ("audin_process_open_reply: result 0x%8.8x", result)); return 0; } /*****************************************************************************/ static int audin_process_incoming_data(int chan_id, struct stream *s) { LOG(10, ("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(10, ("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_insert(&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(0, ("audin_process_format_change:")); if (!s_check_rem(s, 4)) { LOG(0, ("audin_process_format_change: parse error")); return 1; } in_uint32_le(s, g_current_format); LOG(0, ("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(10, ("audin_process_msg:")); if (!s_check_rem(s, 1)) { LOG(0, ("audin_process_msg: parse error")); return 1; } in_uint8(s, code); LOG(10, ("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(0, ("audin_process_msg: unprocessed code %d", code)); break; } return 0; } /*****************************************************************************/ static int audin_open_response(int chan_id, int creation_status) { LOG(0, ("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(0, ("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; int left; LOG(10, ("audin_data_fragment:")); if (!s_check_rem(g_in_s, bytes)) { left = (int) (g_in_s->end - g_in_s->p); LOG(0, ("audin_data_fragment: error bytes %d left %d", bytes, left)); 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(10, ("audin_data_first:")); if (g_in_s != NULL) { LOG(0, ("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(10, ("audin_data:")); //g_hexdump(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(0, ("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(0, ("audin_deinit:")); return 0; } /*****************************************************************************/ int audin_start(void) { int error; struct stream* s; LOG(0, ("audin_start:")); if (g_audin_chanid != 0) { return 1; } /* if there is any data in FIFO, discard it */ while ((s = (struct stream *) fifo_remove(&g_in_fifo)) != NULL) { xstream_free(s); } 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(0, ("audin_start: error %d g_audin_chanid %d", error, g_audin_chanid)); return error; } /*****************************************************************************/ int audin_stop(void) { LOG(0, ("audin_stop:")); chansrv_drdynvc_close(g_audin_chanid); return 0; } xrdp-0.9.12/sesman/chansrv/rail.h000644 001751 001751 00000001722 13544635323 016544 0ustar00metameta000000 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.9.12/sesman/chansrv/devredir.h000644 001751 001751 00000006254 13601643631 017421 0ustar00metameta000000 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); int devredir_file_read(struct state_read *fusep, tui32 device_id, tui32 FileId, tui32 Length, tui64 Offset); int 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.9.12/sesman/chansrv/clipboard-notes.txt000644 001751 001751 00000005154 13544635323 021275 0ustar00metameta000000 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.9.12/sesman/chansrv/smartcard_pcsc.c000644 001751 001751 00000165212 13544635323 020605 0ustar00metameta000000 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 */ #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 "smartcard.h" #include "log.h" #include "irp.h" #include "devredir.h" #include "trans.h" #include "chansrv.h" #include "list.h" #if PCSC_STANDIN #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do \ { \ if (_level < LLOG_LEVEL) \ { \ g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3()); \ g_writeln _args ; \ } \ } \ while (0) 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; LLOGLN(10, ("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; LLOGLN(10, ("get_uds_client_by_id:")); if (uds_client_id == 0) { LLOGLN(10, ("get_uds_client_by_id: uds_client_id zero")); return 0; } if (g_uds_clients == 0) { LLOGLN(10, ("get_uds_client_by_id: g_uds_clients is nil")); return 0; } LLOGLN(10, (" 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; } } LLOGLN(10, ("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; LLOGLN(10, ("get_pcsc_card_by_app_card:")); LLOGLN(10, (" app_card %d", app_card)); if (uds_client == 0) { LLOGLN(0, ("get_pcsc_card_by_app_card: error")); return 0; } if (uds_client->contexts == 0) { LLOGLN(0, ("get_pcsc_card_by_app_card: error")); 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; } } } } } } LLOGLN(0, ("get_pcsc_card_by_app_card: error")); 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; LLOGLN(10, ("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); } LLOGLN(10, (" 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; LLOGLN(10, ("uds_client_add_context:")); pcscContext = (struct pcsc_context *) g_malloc(sizeof(struct pcsc_context), 1); if (pcscContext == 0) { LLOGLN(0, ("uds_client_add_context: error")); 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) { LLOGLN(0, ("uds_client_add_context: error")); 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) { LLOGLN(0, ("uds_client_remove_context: error")); return 1; } index = list_index_of(uds_client->contexts, (tintptr) acontext); if (index < 0) { LLOGLN(0, ("uds_client_remove_context: error")); 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; LLOGLN(10, ("context_add_card: card_bytes %d", card_bytes)); pcscCard = (struct pcsc_card *) g_malloc(sizeof(struct pcsc_card), 1); if (pcscCard == 0) { LLOGLN(0, ("context_add_card: error")); 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) { LLOGLN(0, ("context_add_card: error")); return 0; } } list_add_item(acontext->cards, (tintptr) pcscCard); LLOGLN(10, (" 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; LLOGLN(10, ("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; LLOGLN(10, ("scard_pcsc_check_wait_objs:")); if (g_lis != 0) { if (trans_check_wait_objs(g_lis) != 0) { LLOGLN(0, ("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; LLOGLN(10, ("scard_process_establish_context:")); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, dwScope); LLOGLN(10, ("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; LLOGLN(10, ("scard_function_establish_context_return:")); LLOGLN(10, (" 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) { LLOGLN(0, ("scard_function_establish_context_return: " "get_uds_client_by_id failed")); 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) { LLOGLN(0, ("scard_function_establish_context_return: opps " "context_bytes %d", context_bytes)); g_hexdump(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; LLOGLN(10, ("scard_function_establish_context_return: " "app_context %d", app_context)); } out_s = trans_get_out_s(con, 8192); 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; LLOGLN(10, ("scard_process_release_context:")); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hContext); LLOGLN(10, ("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) { LLOGLN(0, ("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; LLOGLN(10, ("scard_function_release_context_return:")); LLOGLN(10, (" 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) { LLOGLN(0, ("scard_function_release_context_return: " "get_uds_client_by_id failed")); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); 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; int bytes_groups; int cchReaders; char *groups; struct pcsc_uds_client *uds_client; struct pcsc_context *lcontext; struct pcsc_list_readers *pcscListReaders; LLOGLN(10, ("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); groups = (char *) g_malloc(bytes_groups + 1, 1); in_uint8a(in_s, groups, bytes_groups); in_uint32_le(in_s, cchReaders); LLOGLN(10, ("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) { LLOGLN(0, ("scard_process_list_readers: " "get_pcsc_context_by_app_context failed")); g_free(groups); 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); g_free(groups); return 0; } /*****************************************************************************/ int scard_function_list_readers_return(void *user_data, struct stream *in_s, int len, int status) { struct stream *out_s; int chr; int readers; int rn_index; int index; int bytes; int cchReaders; int llen; int uds_client_id; twchar reader_name[100]; char lreader_name[16][100]; struct pcsc_uds_client *uds_client; struct trans *con; struct pcsc_list_readers *pcscListReaders; LLOGLN(10, ("scard_function_list_readers_return:")); LLOGLN(10, (" status 0x%8.8x", status)); pcscListReaders = (struct pcsc_list_readers *) user_data; if (pcscListReaders == 0) { LLOGLN(0, ("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) { LLOGLN(0, ("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; g_memset(reader_name, 0, sizeof(reader_name)); g_memset(lreader_name, 0, sizeof(lreader_name)); rn_index = 0; readers = 0; llen = 0; if (status == 0) { in_uint8s(in_s, 28); in_uint32_le(in_s, len); llen = len; if (cchReaders > 0) { while (len > 0) { in_uint16_le(in_s, chr); len -= 2; if (chr == 0) { if (reader_name[0] != 0) { g_wcstombs(lreader_name[readers], reader_name, 99); g_memset(reader_name, 0, sizeof(reader_name)); readers++; } reader_name[0] = 0; rn_index = 0; } else { reader_name[rn_index] = chr; rn_index++; } } } if (rn_index > 0) { if (reader_name[0] != 0) { g_wcstombs(lreader_name[readers], reader_name, 99); g_memset(reader_name, 0, sizeof(reader_name)); readers++; } } } out_s = trans_get_out_s(con, 8192); s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, llen); out_uint32_le(out_s, readers); for (index = 0; index < readers; index++) { out_uint8a(out_s, lreader_name[index], 100); } 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; LLOGLN(10, ("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); LLOGLN(10, ("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) { LLOGLN(0, ("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; LLOGLN(10, ("scard_function_connect_return:")); LLOGLN(10, (" 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) { LLOGLN(0, ("scard_function_connect_return: " "get_uds_client_by_id failed")); 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; LLOGLN(10, (" hCard %d dwActiveProtocol %d", hCard, dwActiveProtocol)); } else { status = 0x8010000F; /* SCARD_E_PROTO_MISMATCH */ } } out_s = trans_get_out_s(con, 8192); 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; LLOGLN(10, ("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)) { LLOGLN(0, ("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; LLOGLN(10, ("scard_function_disconnect_return:")); LLOGLN(10, (" 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) { LLOGLN(0, ("scard_function_disconnect_return: " "get_uds_client_by_id failed")); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); 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; LLOGLN(10, ("scard_process_begin_transaction:")); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hCard); LLOGLN(10, ("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)) { LLOGLN(0, ("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; LLOGLN(10, ("scard_function_begin_transaction_return:")); LLOGLN(10, (" 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) { LLOGLN(0, ("scard_function_begin_transaction_return: " "get_uds_client_by_id failed")); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); 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; LLOGLN(10, ("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); LLOGLN(10, ("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)) { LLOGLN(0, ("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; LLOGLN(10, ("scard_function_end_transaction_return:")); LLOGLN(10, (" 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) { LLOGLN(0, ("scard_function_end_transaction_return: " "get_uds_client_by_id failed")); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); 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; LLOGLN(10, ("scard_process_transmit:")); uds_client = (struct pcsc_uds_client *) (con->callback_data); LLOGLN(10, ("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); LLOGLN(10, ("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)); LLOGLN(10, ("scard_process_transmit: recv_bytes %d", recv_bytes)); lcard = get_pcsc_card_by_app_card(uds_client, hCard, &lcontext); if ((lcard == 0) || (lcontext == 0)) { LLOGLN(0, ("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; LLOGLN(10, ("scard_function_transmit_return:")); LLOGLN(10, (" 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) { LLOGLN(0, ("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); } } LLOGLN(10, ("scard_function_transmit_return: cbRecvLength %d", cbRecvLength)); out_s = trans_get_out_s(con, 8192); 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; LLOGLN(10, ("scard_process_control:")); uds_client = (struct pcsc_uds_client *) (con->callback_data); LLOGLN(10, ("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)) { LLOGLN(0, ("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; LLOGLN(10, ("scard_function_control_return:")); LLOGLN(10, (" 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) { LLOGLN(0, ("scard_function_control_return: " "get_uds_client_by_id failed")); 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); } LLOGLN(10, ("scard_function_control_return: cbRecvLength %d", cbRecvLength)); out_s = trans_get_out_s(con, 8192); 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; LLOGLN(10, ("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); LLOGLN(10, ("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)) { LLOGLN(0, ("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) { struct stream *out_s; int index; int bytes; int dwReaderLen; int dwState; int dwProtocol; int dwAtrLen; char attr[32]; twchar reader_name[100]; char lreader_name[100]; int uds_client_id; struct pcsc_uds_client *uds_client; struct trans *con; struct pcsc_status *pcscStatus; LLOGLN(10, ("scard_function_status_return:")); LLOGLN(10, (" status 0x%8.8x", status)); pcscStatus = (struct pcsc_status *) user_data; if (pcscStatus == 0) { LLOGLN(0, ("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) { LLOGLN(0, ("scard_function_status_return: " "get_uds_client_by_id failed")); 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, 20); in_uint32_le(in_s, dwReaderLen); in_uint8s(in_s, 4); 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); if (dwReaderLen > 0) { in_uint32_le(in_s, dwReaderLen); dwReaderLen /= 2; } else { dwReaderLen = 1; } if (dwReaderLen < 1) { LLOGLN(0, ("scard_function_status_return: dwReaderLen < 1")); dwReaderLen = 1; } if (dwReaderLen > 99) { LLOGLN(0, ("scard_function_status_return: dwReaderLen too big " "0x%8.8x", dwReaderLen)); dwReaderLen = 99; } g_memset(reader_name, 0, sizeof(reader_name)); g_memset(lreader_name, 0, sizeof(lreader_name)); for (index = 0; index < dwReaderLen - 1; index++) { in_uint16_le(in_s, reader_name[index]); } g_wcstombs(lreader_name, reader_name, 99); } LLOGLN(10, ("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); 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; LLOGLN(10, ("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)) { LLOGLN(0, ("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); LLOGLN(10, ("scard_process_get_status_change: reader_name %s", rsa[index].reader_name)); in_uint32_le(in_s, rsa[index].current_state); LLOGLN(10, ("scard_process_get_status_change: current_state %d", rsa[index].current_state)); in_uint32_le(in_s, rsa[index].event_state); LLOGLN(10, ("scard_process_get_status_change: event_state %d", rsa[index].event_state)); in_uint32_le(in_s, rsa[index].atr_len); LLOGLN(10, ("scard_process_get_status_change: atr_len %d", rsa[index].atr_len)); in_uint8a(in_s, rsa[index].atr, 36); } LLOGLN(10, ("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) { LLOGLN(0, ("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; LLOGLN(10, ("scard_function_get_status_change_return:")); LLOGLN(10, (" 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) { LLOGLN(0, ("scard_function_get_status_change_return: " "get_uds_client_by_id failed")); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); 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); LLOGLN(10, (" 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; LLOGLN(10, ("scard_process_cancel:")); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hContext); LLOGLN(10, ("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) { LLOGLN(0, ("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; LLOGLN(10, ("scard_function_cancel_return:")); LLOGLN(10, (" 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) { LLOGLN(0, ("scard_function_cancel_return: " "get_uds_client_by_id failed")); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); 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; LLOGLN(10, ("scard_process_msg: command 0x%4.4x", command)); rv = 0; switch (command) { case 0x01: /* SCARD_ESTABLISH_CONTEXT */ LLOGLN(10, ("scard_process_msg: SCARD_ESTABLISH_CONTEXT")); rv = scard_process_establish_context(con, in_s); break; case 0x02: /* SCARD_RELEASE_CONTEXT */ LLOGLN(10, ("scard_process_msg: SCARD_RELEASE_CONTEXT")); rv = scard_process_release_context(con, in_s); break; case 0x03: /* SCARD_LIST_READERS */ LLOGLN(10, ("scard_process_msg: SCARD_LIST_READERS")); rv = scard_process_list_readers(con, in_s); break; case 0x04: /* SCARD_CONNECT */ LLOGLN(10, ("scard_process_msg: SCARD_CONNECT")); rv = scard_process_connect(con, in_s); break; case 0x05: /* SCARD_RECONNECT */ LLOGLN(0, ("scard_process_msg: SCARD_RECONNECT")); break; case 0x06: /* SCARD_DISCONNECT */ LLOGLN(10, ("scard_process_msg: SCARD_DISCONNECT")); rv = scard_process_disconnect(con, in_s); break; case 0x07: /* SCARD_BEGIN_TRANSACTION */ LLOGLN(10, ("scard_process_msg: SCARD_BEGIN_TRANSACTION")); rv = scard_process_begin_transaction(con, in_s); break; case 0x08: /* SCARD_END_TRANSACTION */ LLOGLN(10, ("scard_process_msg: SCARD_END_TRANSACTION")); rv = scard_process_end_transaction(con, in_s); break; case 0x09: /* SCARD_TRANSMIT */ LLOGLN(10, ("scard_process_msg: SCARD_TRANSMIT")); rv = scard_process_transmit(con, in_s); break; case 0x0A: /* SCARD_CONTROL */ LLOGLN(10, ("scard_process_msg: SCARD_CONTROL")); rv = scard_process_control(con, in_s); break; case 0x0B: /* SCARD_STATUS */ LLOGLN(10, ("scard_process_msg: SCARD_STATUS")); rv = scard_process_status(con, in_s); break; case 0x0C: /* SCARD_GET_STATUS_CHANGE */ LLOGLN(10, ("scard_process_msg: SCARD_GET_STATUS_CHANGE")); rv = scard_process_get_status_change(con, in_s); break; case 0x0D: /* SCARD_CANCEL */ LLOGLN(10, ("scard_process_msg: SCARD_CANCEL")); rv = scard_process_cancel(con, in_s); break; case 0x0E: /* SCARD_CANCEL_TRANSACTION */ LLOGLN(0, ("scard_process_msg: SCARD_CANCEL_TRANSACTION")); break; case 0x0F: /* SCARD_GET_ATTRIB */ LLOGLN(0, ("scard_process_msg: SCARD_GET_ATTRIB")); break; case 0x10: /* SCARD_SET_ATTRIB */ LLOGLN(0, ("scard_process_msg: SCARD_SET_ATTRIB")); break; default: LLOGLN(0, ("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; LLOGLN(10, ("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); LLOGLN(10, ("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; LLOGLN(10, ("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; LLOGLN(0, ("scard_pcsc_init:")); if (g_lis == 0) { g_lis = trans_create(2, 8192, 8192); 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)) { LLOGLN(0, ("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)) { LLOGLN(0, ("scard_pcsc_init: g_create_dir failed")); } } } g_chmod_hex(g_pcsclite_ipc_dir, 0x1777); 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) { LLOGLN(0, ("scard_pcsc_init: trans_listen failed for port %s", g_pcsclite_ipc_file)); return 1; } } return 0; } /*****************************************************************************/ int scard_pcsc_deinit(void) { LLOGLN(0, ("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)) { LLOGLN(0, ("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.9.12/sesman/chansrv/sound.h000644 001751 001751 00000003363 13544635323 016750 0ustar00metameta000000 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.9.12/sesman/chansrv/chansrv.c000644 001751 001751 00000143723 13601643631 017257 0ustar00metameta000000 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 "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 "xrdp_sockets.h" #include "audin.h" 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 tbus g_thread_done_event = 0; static int g_use_unix_socket = 0; int g_display_num = 0; 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 */ int g_restrict_outbound_clipboard = 0; char *g_exec_name; tbus g_exec_event; 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(10, ("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(10, ("get_timeout:")); ltimeout = *timeout; if (ltimeout < 1) { ltimeout = 0; } tobj = g_timeout_head; if (tobj != 0) { now = g_time3(); while (tobj != 0) { LOG(10, (" now %u tobj->mstime %u", now, tobj->mstime)); if (now < tobj->mstime) { ltimeout = tobj->mstime - now; } tobj = tobj->next; } } if (ltimeout > 0) { LOG(10, (" 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; LOG(10, ("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(10, (" 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) { LOGM((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); 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; LOGM((LOG_LEVEL_DEBUG, "process_message_channel_setup:")); in_uint16_le(s, num_chans); LOGM((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); LOGM((LOG_LEVEL_DEBUG, "process_message_channel_setup: chan name '%s' " "id %d flags %8.8x", ci->name, ci->id, ci->flags)); g_writeln("process_message_channel_setup: chan name '%s' " "id %d flags %8.8x", ci->name, ci->id, ci->flags); if (g_strcasecmp(ci->name, "cliprdr") == 0) { g_cliprdr_index = g_num_chan_items; g_cliprdr_chan_id = ci->id; } else if (g_strcasecmp(ci->name, "rdpsnd") == 0) { g_rdpsnd_index = g_num_chan_items; g_rdpsnd_chan_id = ci->id; } else if (g_strcasecmp(ci->name, "rdpdr") == 0) { g_rdpdr_index = g_num_chan_items; g_rdpdr_chan_id = ci->id; } /* disabled for now */ else if (g_strcasecmp(ci->name, "rail") == 0) { g_rail_index = g_num_chan_items; g_rail_chan_id = ci->id; } else { LOG(10, ("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); LOGM((LOG_LEVEL_DEBUG, "process_message_channel_data: chan_id %d " "chan_flags %d", chan_id, chan_flags)); LOG(10, ("process_message_channel_data")); 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(0, ("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(10, ("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) { g_writeln("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(10, ("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) { g_writeln("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(10, ("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(10, ("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; //g_writeln("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; //g_writeln("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; //g_writeln("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: LOGM((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; } LOGM((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; int channel_name_bytes; struct chansrv_drdynvc_procs procs; char *chan_name; //g_writeln("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); //g_writeln("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); //g_writeln("my_api_trans_data_in: channel_name_bytes %d", channel_name_bytes); chan_name = g_new0(char, channel_name_bytes + 1); if (chan_name == NULL) { return 1; } in_uint8a(s, chan_name, channel_name_bytes); in_uint32_le(s, ad->chan_flags); //g_writeln("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)); //g_writeln("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; } g_free(chan_name); 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) { //g_writeln("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 */ //g_writeln("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; } LOGM((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; //g_writeln("my_api_trans_conn_in:"); if ((trans == NULL) || (trans != g_api_lis_trans) || (new_trans == NULL)) { g_writeln("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) { g_writeln("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[256]; int error = 0; if (g_lis_trans != 0) { trans_delete(g_lis_trans); } if (g_use_unix_socket) { g_lis_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192); g_lis_trans->is_term = g_is_term; g_snprintf(port, 255, XRDP_CHANSRV_STR, g_display_num); } else { g_lis_trans = trans_create(TRANS_MODE_TCP, 8192, 8192); g_lis_trans->is_term = g_is_term; g_snprintf(port, 255, "%d", 7200 + g_display_num); } g_lis_trans->trans_conn_in = my_trans_conn_in; error = trans_listen(g_lis_trans, port); if (error != 0) { LOGM((LOG_LEVEL_ERROR, "setup_listen: trans_listen failed for port %s", port)); return 1; } return 0; } /*****************************************************************************/ static int setup_api_listen(void) { char port[256]; 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, 255, CHANSRV_API_STR, 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) { LOGM((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; LOGM((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)) { LOGM((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) { LOGM((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) { LOGM((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(0, ("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); LOGM((LOG_LEVEL_INFO, "channel_thread_loop: thread stop")); g_set_wait_obj(g_thread_done_event); return rv; } /*****************************************************************************/ void term_signal_handler(int sig) { LOGM((LOG_LEVEL_INFO, "term_signal_handler: got signal %d", sig)); g_set_wait_obj(g_term_event); } /*****************************************************************************/ void nil_signal_handler(int sig) { LOGM((LOG_LEVEL_INFO, "nil_signal_handler: got signal %d", sig)); } /*****************************************************************************/ void child_signal_handler(int sig) { int pid; LOG(0, ("child_signal_handler:")); do { pid = g_waitchild(); LOG(0, ("child_signal_handler: child pid %d", pid)); if ((pid == g_exec_pid) && (pid > 0)) { LOG(0, ("child_signal_handler: found pid %d", pid)); //shutdownx(); } } while (pid >= 0); } /*****************************************************************************/ void segfault_signal_handler(int sig) { LOG(0, ("segfault_signal_handler: entered.......")); xfuse_deinit(); exit(0); } /*****************************************************************************/ static void x_server_fatal_handler(void) { LOGM((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); } /*****************************************************************************/ static int get_display_num_from_display(char *display_text) { int index; int mode; int host_index; int disp_index; int scre_index; char host[256]; char disp[256]; char scre[256]; g_memset(host, 0, 256); g_memset(disp, 0, 256); g_memset(scre, 0, 256); index = 0; host_index = 0; disp_index = 0; scre_index = 0; mode = 0; while (display_text[index] != 0) { if (display_text[index] == ':') { mode = 1; } else if (display_text[index] == '.') { mode = 2; } else if (mode == 0) { host[host_index] = display_text[index]; host_index++; } else if (mode == 1) { disp[disp_index] = display_text[index]; disp_index++; } else if (mode == 2) { scre[scre_index] = display_text[index]; scre_index++; } index++; } host[host_index] = 0; disp[disp_index] = 0; scre[scre_index] = 0; g_display_num = g_atoi(disp); return 0; } /*****************************************************************************/ int main_cleanup(void) { g_delete_wait_obj(g_term_event); g_delete_wait_obj(g_thread_done_event); g_delete_wait_obj(g_exec_event); tc_mutex_delete(g_exec_mutex); g_deinit(); /* os_calls */ return 0; } /*****************************************************************************/ static int read_ini(void) { char filename[256]; struct list *names; struct list *values; char *name; char *value; int index; g_memset(filename, 0, (sizeof(char) * 256)); names = list_create(); names->auto_free = 1; values = list_create(); values->auto_free = 1; g_use_unix_socket = 0; g_snprintf(filename, 255, "%s/sesman.ini", XRDP_CFG_PATH); if (file_by_name_read_section(filename, "Globals", names, values) == 0) { for (index = 0; index < names->count; index++) { name = (char *)list_get_item(names, index); value = (char *)list_get_item(values, index); if (g_strcasecmp(name, "ListenAddress") == 0) { if (g_strcasecmp(value, "127.0.0.1") == 0) { g_use_unix_socket = 1; } } } } list_delete(names); list_delete(values); 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 enum logLevels get_log_level(const char* level_str, enum logLevels default_level) { static const char* levels[] = { "LOG_LEVEL_ALWAYS", "LOG_LEVEL_ERROR", "LOG_LEVEL_WARNING", "LOG_LEVEL_INFO", "LOG_LEVEL_DEBUG", "LOG_LEVEL_TRACE" }; unsigned int i; if (level_str == NULL || level_str[0] == 0) { return default_level; } for (i = 0; i < ARRAYSIZE(levels); ++i) { if (g_strcasecmp(levels[i], level_str) == 0) { return (enum logLevels) i; } } return default_level; } /*****************************************************************************/ static int run_exec(void) { int pid; LOG(10, ("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_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]; char log_path[256]; char *display_text; char log_file[256]; enum logReturns error; struct log_config logconfig; enum logLevels log_level; char *restrict_outbound_clipboard_env; g_init("xrdp-chansrv"); /* os_calls */ log_path[255] = 0; if (get_log_path(log_path, 255) != 0) { g_writeln("error reading CHANSRV_LOG_PATH and HOME environment variable"); g_deinit(); return 1; } restrict_outbound_clipboard_env = g_getenv("CHANSRV_RESTRICT_OUTBOUND_CLIPBOARD"); if (restrict_outbound_clipboard_env != 0) { if (g_strcmp(restrict_outbound_clipboard_env, "1") == 0) { g_restrict_outbound_clipboard = 1; } } read_ini(); pid = g_getpid(); display_text = g_getenv("DISPLAY"); if (display_text) get_display_num_from_display(display_text); log_level = get_log_level(g_getenv("CHANSRV_LOG_LEVEL"), LOG_LEVEL_INFO); /* starting logging subsystem */ g_memset(&logconfig, 0, sizeof(struct log_config)); logconfig.program_name = "xrdp-chansrv"; 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); } g_memset(g_drdynvcs, 0, sizeof(g_drdynvcs)); logconfig.log_file = log_file; logconfig.fd = -1; logconfig.log_level = log_level; logconfig.enable_syslog = 0; logconfig.syslog_level = LOG_LEVEL_ALWAYS; error = log_start_from_param(&logconfig); 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; } g_deinit(); return 1; } LOGM((LOG_LEVEL_ALWAYS, "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(child_signal_handler); /* SIGCHLD */ g_signal_segfault(segfault_signal_handler); /* Cater for the X server exiting unexpectedly */ xcommon_set_x_server_fatal_handler(x_server_fatal_handler); LOGM((LOG_LEVEL_INFO, "main: DISPLAY env var set to %s", display_text)); if (g_display_num == 0) { LOGM((LOG_LEVEL_ERROR, "main: error, display is zero")); g_deinit(); return 1; } LOGM((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_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; if (g_obj_wait(waiters, 2, 0, 0, 0) != 0) { LOGM((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_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, 0) != 0) { LOGM((LOG_LEVEL_ERROR, "main: error, g_obj_wait failed")); break; } } /* cleanup */ main_cleanup(); LOGM((LOG_LEVEL_INFO, "main: app exiting pid %d(0x%8.8x)", pid, pid)); g_deinit(); return 0; } xrdp-0.9.12/sesman/chansrv/ms-smb2.h000644 001751 001751 00000005423 13601643631 017072 0ustar00metameta000000 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.9.12/sesman/chansrv/ms-fscc.h000644 001751 001751 00000003640 13601643631 017144 0ustar00metameta000000 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.9.12/sesman/chansrv/clipboard_file.h000644 001751 001751 00000002444 13544635323 020555 0ustar00metameta000000 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); int clipboard_c2s_in_files(struct stream *s, char *file_list); 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.9.12/sesman/chansrv/clipboard.c000644 001751 001751 00000245135 13544635323 017557 0ustar00metameta000000 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 "chansrv.h" #include "clipboard.h" #include "clipboard_file.h" #include "clipboard_common.h" #include "xcommon.h" #include "chansrv_fuse.h" /* module based logging */ #define LOG_ERROR 0 #define LOG_INFO 1 #define LOG_DEBUG 2 #undef LOG_LEVEL #define LOG_LEVEL LOG_ERROR #define log_error(_params...) \ { \ g_write("[%10.10u]: CLIPBOARD %s: %d : ERROR: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } #define log_always(_params...) \ { \ g_write("[%10.10u]: CLIPBOARD %s: %d : ALWAYS: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } #define log_info(_params...) \ { \ if (LOG_INFO <= LOG_LEVEL) \ { \ g_write("[%10.10u]: CLIPBOARD %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } #define log_debug(_params...) \ { \ if (LOG_DEBUG <= LOG_LEVEL) \ { \ g_write("[%10.10u]: CLIPBOARD %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } static char g_bmp_image_header[] = { /* this is known to work */ //0x42, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* THIS IS BEING SENT BY WIN2008 */ 0x42, 0x4d, 0x16, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00 }; 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 int g_restrict_outbound_clipboard; /* 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 = 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; static int g_file_format_id = -1; static char g_last_atom_name[256] = ""; /*****************************************************************************/ 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(0, ("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_error("clipboard_init: XInternAtom failed"); rv = 3; } } if (rv == 0) { if (!XFixesQueryExtension(g_display, &g_xfixes_event_base, &dummy)) { log_error("clipboard_init: no xfixes"); rv = 5; } } if (rv == 0) { log_debug("clipboard_init: g_xfixes_event_base %d", g_xfixes_event_base); st = XFixesQueryVersion(g_display, &ver_maj, &ver_min); log_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_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, 1); /* 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_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_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_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_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_error("xrdp-chansrv: clipboard_init: error on exit"); } return rv; } /*****************************************************************************/ int clipboard_deinit(void) { LOG(0, ("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_debug("clipboard_send_data_request:"); log_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_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_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; } /*****************************************************************************/ /* returns number of bytes written */ int clipboard_out_unicode(struct stream *s, const char *text, int num_chars) { int index; int lnum_chars; twchar *ltext; if ((num_chars < 1) || (text == 0)) { return 0; } lnum_chars = g_mbstowcs(0, text, num_chars); if (lnum_chars < 0) { return 0; } ltext = (twchar *) g_malloc((num_chars + 1) * sizeof(twchar), 1); g_mbstowcs(ltext, text, num_chars); index = 0; while (index < num_chars) { out_uint16_le(s, ltext[index]); index++; } g_free(ltext); return index * 2; } /*****************************************************************************/ /* returns number of bytes read */ int clipboard_in_unicode(struct stream *s, char *text, int *num_chars) { int index; twchar *ltext; twchar chr; if ((num_chars == 0) || (*num_chars < 1) || (text == 0)) { return 0; } ltext = (twchar *) g_malloc(512 * sizeof(twchar), 1); index = 0; while (s_check_rem(s, 2)) { in_uint16_le(s, chr); if (index < 511) { ltext[index] = chr; } index++; if (chr == 0) { break; } } *num_chars = g_wcstombs(text, ltext, *num_chars); g_free(ltext); return index * 2; } 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_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_debug("clipboard_send_format_announce: XRDP_CB_FILE"); /* canned response for "file" */ out_uint32_le(s, 0x0000c0bc); clipboard_out_unicode(s, "FileGroupDescriptorW", 21); out_uint32_le(s, 0x0000c0ba); clipboard_out_unicode(s, "FileContents", 13); out_uint32_le(s, 0x0000c0c1); clipboard_out_unicode(s, "DropEffect", 11); break; case XRDP_CB_BITMAP: log_debug("clipboard_send_format_announce: XRDP_CB_BITMAP"); /* canned response for "bitmap" */ out_uint32_le(s, 0x0000c004); clipboard_out_unicode(s, "Native", 7); out_uint32_le(s, 0x00000003); clipboard_out_unicode(s, "", 1); out_uint32_le(s, 0x00000008); clipboard_out_unicode(s, "", 1); out_uint32_le(s, 0x00000011); clipboard_out_unicode(s, "", 1); break; case XRDP_CB_TEXT: log_debug("clipboard_send_format_announce: XRDP_CB_TEXT"); /* canned response for "bitmap" */ out_uint32_le(s, 0x0000000d); clipboard_out_unicode(s, "", 1); out_uint32_le(s, 0x00000010); clipboard_out_unicode(s, "", 1); out_uint32_le(s, 0x00000001); clipboard_out_unicode(s, "", 1); out_uint32_le(s, 0x00000007); clipboard_out_unicode(s, "", 1); break; default: log_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_debug("clipboard_send_format_announce: XRDP_CB_FILE"); /* canned response for "file" */ out_uint32_le(s, 0x0000c0bc); 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_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_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_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); //g_hexdump(s->data, size); log_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_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_chars; log_debug("clipboard_send_data_response_for_text: data_size %d", data_size); //g_hexdump(data, data_size); num_chars = g_mbstowcs(0, data, 0); if (num_chars < 0) { log_error("clipboard_send_data_response_for_text: " "bad string"); num_chars = 0; } log_debug("clipboard_send_data_response_for_text: data_size %d " "num_chars %d", data_size, num_chars); make_stream(s); init_stream(s, 64 + num_chars * 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_chars * 2 + 2); /* length */ if (clipboard_out_unicode(s, data, num_chars) != num_chars * 2) { log_error("clipboard_send_data_response_for_text: error " "clipboard_out_unicode didn't write right number of bytes"); } out_uint16_le(s, 0); /* nil for string */ out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); log_debug("clipboard_send_data_response_for_text: data out, " "sending CLIPRDR_DATA_RESPONSE (clip_msg_id = 5) size %d " "num_chars %d", size, num_chars); 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_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_debug("clipboard_send_data_response: unknown " "xrdp_clip_type %d", xrdp_clip_type); } } else { log_error("clipboard_send_data_response: data is nil"); } return 0; } /*****************************************************************************/ static int clipboard_set_selection_owner(void) { Window owner; log_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_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_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_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 count; int bytes; char desc[256]; char *holdp; log_debug("clipboard_process_format_announce: " "CLIPRDR_FORMAT_ANNOUNCE"); log_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 */ count = 255; bytes = clipboard_in_unicode(s, desc, &count); clip_msg_len -= bytes; } else { /* CLIPRDR_SHORT_FORMAT_NAME */ /* 32 ASCII 8 characters or 16 Unicode characters */ count = 15; holdp = s->p; clipboard_in_unicode(s, desc, &count); s->p = holdp + 32; desc[15] = 0; clip_msg_len -= 32; } log_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_debug("clipboard_process_format_announce: max formats"); } /* format id for file copy copy seems to keep changing */ /* seen 0x0000c0c8, 0x0000c0ed */ if (g_strcmp(desc, "FileGroupDescriptorW") == 0) { g_file_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_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_debug("clipboard_process_format_ack: CLIPRDR_FORMAT_ACK"); log_debug("clipboard_process_format_ack:"); return 0; } /*****************************************************************************/ static int clipboard_send_data_response_failed(void) { struct stream *s; int size; int rv; log_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_debug("clipboard_process_data_request: " "CLIPRDR_DATA_REQUEST"); log_debug("clipboard_process_data_request:"); log_debug(" %d", g_clip_s2c.xrdp_clip_type); in_uint32_le(s, requestedFormatId); switch (requestedFormatId) { case CB_FORMAT_FILE: /* 0xC0BC */ if ((g_clip_s2c.xrdp_clip_type == XRDP_CB_FILE) && g_clip_s2c.converted) { log_debug("clipboard_process_data_request: CB_FORMAT_FILE"); clipboard_send_data_response(XRDP_CB_FILE, g_clip_s2c.data, g_clip_s2c.total_bytes); } else { log_debug("clipboard_process_data_request: CB_FORMAT_FILE, " "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 CB_FORMAT_DIB: /* 0x0008 */ if ((g_clip_s2c.xrdp_clip_type == XRDP_CB_BITMAP) && g_clip_s2c.converted) { log_debug("clipboard_process_data_request: CB_FORMAT_DIB"); clipboard_send_data_response(XRDP_CB_BITMAP, g_clip_s2c.data, g_clip_s2c.total_bytes); } else { log_debug("clipboard_process_data_request: CB_FORMAT_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 CB_FORMAT_UNICODETEXT: /* 0x000D */ if ((g_clip_s2c.xrdp_clip_type == XRDP_CB_TEXT) && g_clip_s2c.converted) { log_debug("clipboard_process_data_request: CB_FORMAT_UNICODETEXT"); clipboard_send_data_response(XRDP_CB_TEXT, g_clip_s2c.data, g_clip_s2c.total_bytes); } else { log_debug("clipboard_process_data_request: CB_FORMAT_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_debug("clipboard_process_data_request: unknown type %d", requestedFormatId); clipboard_send_data_response_failed(); break; } 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_for_image(struct stream *s, int clip_msg_status, int clip_msg_len) { XSelectionRequestEvent *lxev; int len; log_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 + 14, 0); if (g_clip_c2s.data == 0) { g_clip_c2s.total_bytes = 0; return 0; } g_clip_c2s.total_bytes = len; g_clip_c2s.read_bytes_done = g_clip_c2s.total_bytes; g_memcpy(g_clip_c2s.data, g_bmp_image_header, 14); in_uint8a(s, g_clip_c2s.data + 14, len); log_debug("clipboard_process_data_response_for_image: calling " "clipboard_provide_selection_c2s"); 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) { XSelectionRequestEvent *lxev; twchar *wtext; twchar wchr; int len; int index; log_debug("clipboard_process_data_response:"); lxev = &g_saved_selection_req_event; g_clip_c2s.in_request = 0; if (g_clip_c2s.xrdp_clip_type == XRDP_CB_BITMAP) { clipboard_process_data_response_for_image(s, clip_msg_status, clip_msg_len); return 0; } if (g_clip_c2s.xrdp_clip_type == XRDP_CB_FILE) { g_free(g_clip_c2s.data); g_clip_c2s.data = (char *)g_malloc(1024 * 1024, 1); /* text/uri-list */ if (g_clip_c2s.type == g_file_atom1) { clipboard_c2s_in_files(s, g_clip_c2s.data); } /* x-special/gnome-copied-files */ else if (g_clip_c2s.type == g_file_atom2) { g_strcpy(g_clip_c2s.data, "copy\n"); clipboard_c2s_in_files(s, g_clip_c2s.data + 5); } else { log_error("clipboard_process_data_response: error"); } g_clip_c2s.total_bytes = 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 0; } log_debug("clipboard_process_data_response: " "CLIPRDR_DATA_RESPONSE"); len = (int)(s->end - s->p); if (len < 1) { return 0; } wtext = (twchar *) g_malloc(((len / 2) + 1) * sizeof(twchar), 0); if (wtext == 0) { return 0; } index = 0; while (s_check(s)) { in_uint16_le(s, wchr); wtext[index] = wchr; if (wchr == 0) { break; } index++; } wtext[index] = 0; g_free(g_clip_c2s.data); g_clip_c2s.data = 0; g_clip_c2s.total_bytes = 0; len = g_wcstombs(0, wtext, 0); if (len >= 0) { g_clip_c2s.data = (char *) g_malloc(len + 16, 0); if (g_clip_c2s.data == 0) { g_free(wtext); return 0; } g_wcstombs(g_clip_c2s.data, wtext, len + 1); } if (g_clip_c2s.data != 0) { g_clip_c2s.total_bytes = g_strlen(g_clip_c2s.data); g_clip_c2s.read_bytes_done = g_clip_c2s.total_bytes; clipboard_provide_selection_c2s(lxev, lxev->target); } g_free(wtext); return 0; } /*****************************************************************************/ 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_debug("clipboard_process_clip_caps:"); //g_hexdump(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_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_debug("clipboard_process_clip_caps: unknown " "capabilitySetType %d", capabilitySetType); break; } s->p = holdp + lengthCapability; } return 0; } /*****************************************************************************/ static int ss_part(char *data, int data_bytes) { int index; char *text; log_debug("ss_part: data_bytes %d read_bytes_done %d " "incr_bytes_done %d", data_bytes, g_clip_c2s.read_bytes_done, g_clip_c2s.incr_bytes_done); /* copy to buffer */ if (g_clip_c2s.type == g_utf8_atom) { /* todo unicode */ text = (char *)g_malloc(data_bytes, 0); index = 0; data_bytes /= 2; while (index < data_bytes) { text[index] = data[index * 2]; index++; } text[index] = 0; g_memcpy(g_clip_c2s.data + g_clip_c2s.read_bytes_done, text, data_bytes); g_clip_c2s.read_bytes_done += data_bytes; g_free(text); } else { g_memcpy(g_clip_c2s.data + g_clip_c2s.read_bytes_done, data, data_bytes); g_clip_c2s.read_bytes_done += data_bytes; } if (g_clip_c2s.incr_in_progress) { log_debug("ss_part: incr_in_progress set"); return 0; } if (g_clip_c2s.read_bytes_done <= g_clip_c2s.incr_bytes_done) { log_debug("ss_part: read_bytes_done < incr_bytes_done"); return 0; } data = 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 > g_incr_max_req_size) { data_bytes = g_incr_max_req_size; } g_clip_c2s.incr_bytes_done += data_bytes; XChangeProperty(g_display, g_clip_c2s.window, g_clip_c2s.property, g_clip_c2s.type, 8, PropModeReplace, (tui8 *)data, data_bytes); g_clip_c2s.incr_in_progress = 1; return 0; } /*****************************************************************************/ static int ss_end(void) { char *data; int data_bytes; log_debug("ss_end:"); g_clip_c2s.doing_response_ss = 0; g_clip_c2s.in_request = 0; if (g_clip_c2s.incr_in_progress) { log_debug("ss_end: incr_in_progress set"); return 0; } if (g_clip_c2s.read_bytes_done <= g_clip_c2s.incr_bytes_done) { log_debug("ss_end: read_bytes_done < incr_bytes_done"); return 0; } data = 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 > g_incr_max_req_size) { data_bytes = g_incr_max_req_size; } g_clip_c2s.incr_bytes_done += data_bytes; XChangeProperty(g_display, g_clip_c2s.window, g_clip_c2s.property, g_clip_c2s.type, 8, PropModeReplace, (tui8 *)data, data_bytes); g_clip_c2s.incr_in_progress = 1; return 0; } /*****************************************************************************/ static int ss_start(char *data, int data_bytes, int total_bytes) { XEvent xev; XSelectionRequestEvent *req; long val1[2]; int incr_bytes; log_debug("ss_start: data_bytes %d total_bytes %d", data_bytes, total_bytes); req = &g_saved_selection_req_event; incr_bytes = total_bytes; if (req->target == g_image_bmp_atom) { incr_bytes += 14; } else if (req->target == g_utf8_atom) { incr_bytes /= 2; } val1[0] = incr_bytes; /* a guess */ val1[1] = 0; g_clip_c2s.doing_response_ss = 1; g_clip_c2s.incr_bytes_done = 0; g_clip_c2s.read_bytes_done = 0; g_clip_c2s.type = req->target; g_clip_c2s.property = req->property; g_clip_c2s.window = req->requestor; g_free(g_clip_c2s.data); g_clip_c2s.data = (char *)g_malloc(incr_bytes + 64, 0); g_clip_c2s.total_bytes = incr_bytes; 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); if (req->target == g_image_bmp_atom) { g_memcpy(g_clip_c2s.data, g_bmp_image_header, 14); g_clip_c2s.read_bytes_done = 14; } g_clip_c2s.incr_in_progress = 1; ss_part(data, data_bytes); 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; char *holdp; if (!g_clip_up) { log_error("aborting clipboard_data_in - clipboard has not " "been initialized"); /* we return 0 here to indicate no protocol problem occurred */ return 0; } log_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 (g_clip_c2s.doing_response_ss) { ss_part(s->p, length); if ((chan_flags & 3) == 2) { log_debug("clipboard_data_in: calling ss_end"); ss_end(); } return 0; } if (g_clip_c2s.in_request) { if (total_length > 32 * 1024) { if ((chan_flags & 3) == 1) { holdp = s->p; in_uint16_le(s, clip_msg_id); in_uint16_le(s, clip_msg_status); in_uint32_le(s, clip_msg_len); if (clip_msg_id == CB_FORMAT_DATA_RESPONSE) { ss_start(s->p, length - 8, total_length - 8); return 0; } s->p = holdp; } } } 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_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_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_debug("clipboard_data_in: unknown clip_msg_id %d", clip_msg_id); log_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_debug("clipboard_event_selection_owner_notify: 0x%lx", lxevent->owner); log_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_debug("clipboard_event_selection_owner_notify: matches g_wnd"); log_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_debug("clipboard_get_window_property:"); log_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_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_error("clipboard_event_selection_notify: clip could " "not be converted"); rv = 1; } if (rv == 0) { log_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_error("clipboard_event_selection_notify: " "clipboard_get_window_property failed error %d", rv); return 0; } //g_hexdump(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_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; //g_hexdump(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]; LOGM((LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: 0x%lx %s 0x%lx", atom, get_atom_text(atom), XA_STRING)); log_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_debug("clipboard_event_selection_notify: file"); got_file_atom = atom; } else { log_error("clipboard_event_selection_notify: unknown atom 0x%lx", atom); } } } else { log_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_debug("clipboard_event_selection_notify: UTF8_STRING " "data_size %d", data_size); log_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) { clipboard_send_data_response_for_file(g_clip_s2c.data, g_clip_s2c.total_bytes); } else { clipboard_send_data_response_for_text(g_clip_s2c.data, g_clip_s2c.total_bytes); } } } else if (lxevent->target == XA_STRING) { log_debug("clipboard_event_selection_notify: XA_STRING " "data_size %d", data_size); log_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; clipboard_send_data_response_for_text(g_clip_s2c.data, g_clip_s2c.total_bytes); } } else if (lxevent->target == g_image_bmp_atom) { log_debug("clipboard_event_selection_notify: image/bmp " "data_size %d", data_size); log_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); 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_debug("clipboard_event_selection_notify: text/uri-list " "data_size %d", data_size); log_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; clipboard_send_data_response_for_file(g_clip_s2c.data, g_clip_s2c.total_bytes); } } else if (lxevent->target == g_file_atom2) { log_debug("clipboard_event_selection_notify: text/uri-list " "data_size %d", data_size); log_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; clipboard_send_data_response_for_file(g_clip_s2c.data, g_clip_s2c.total_bytes); } } else { log_error("clipboard_event_selection_notify: " "unknown target"); } } else { log_error("clipboard_event_selection_notify: " "unknown selection"); } } if (got_file_atom != 0) { /* text/uri-list or x-special/gnome-copied-files */ 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) { 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) { 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) { 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_debug("clipboard_event_selection_request: 0x%lx", lxev->property); log_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_debug("clipboard_event_selection_request: lxev->property " "is None"); log_debug("clipboard_event_selection_request: " "lxev->property is None"); } else if (lxev->target == g_targets_atom) { log_debug("clipboard_event_selection_request: g_targets_atom"); /* requestor is asking what the selection can be converted to */ log_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_buf[3] = XA_STRING; atom_buf[4] = g_utf8_atom; atom_count = 5; if (clipboard_find_format_id(CB_FORMAT_DIB) >= 0) { log_debug(" reporting image/bmp"); atom_buf[atom_count] = g_image_bmp_atom; atom_count++; } if (clipboard_find_format_id(g_file_format_id) >= 0) { log_debug(" reporting text/uri-list"); atom_buf[atom_count] = g_file_atom1; atom_count++; log_debug(" reporting x-special/gnome-copied-files"); atom_buf[atom_count] = g_file_atom2; atom_count++; } atom_buf[atom_count] = 0; log_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_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_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_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)) { 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(CB_FORMAT_UNICODETEXT); return 0; } else if (lxev->target == g_image_bmp_atom) { log_debug("clipboard_event_selection_request: image/bmp"); if ((g_clip_c2s.type == lxev->target) && g_clip_c2s.converted) { log_debug("clipboard_event_selection_request: -------------------------------------------"); clipboard_provide_selection_c2s(lxev, lxev->target); return 0; } 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(CB_FORMAT_DIB); return 0; } else if (lxev->target == g_file_atom1) { log_debug("clipboard_event_selection_request: g_file_atom1"); if ((g_clip_c2s.type == lxev->target) && g_clip_c2s.converted) { log_debug("clipboard_event_selection_request: -------------------------------------------"); clipboard_provide_selection_c2s(lxev, lxev->target); return 0; } 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_format_id); return 0; } else if (lxev->target == g_file_atom2) { log_debug("clipboard_event_selection_request: g_file_atom2"); if ((g_clip_c2s.type == lxev->target) && g_clip_c2s.converted) { log_debug("clipboard_event_selection_request: -------------------------------------------"); clipboard_provide_selection_c2s(lxev, lxev->target); return 0; } 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_format_id); return 0; } else { log_debug("clipboard_event_selection_request: unknown " "target %s", get_atom_text(lxev->target)); LOGM((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_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_debug("clipboard_event_property_notify:"); log_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_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_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_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_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_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_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; //g_hexdump(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_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); g_memcpy(cptr, g_clip_s2c.data, g_clip_s2c.total_bytes); g_free(g_clip_s2c.data); if (cptr == NULL) { g_clip_s2c.data = 0; /* cannot add any more data */ if (data != 0) { XFree(data); } XDeleteProperty(g_display, g_wnd, g_clip_s2c.property); return 0; } log_debug("clipboard_event_property_notify: new_data_len %d", new_data_len); g_clip_s2c.data = cptr; g_memcpy(g_clip_s2c.data + g_clip_s2c.total_bytes, data, new_data_len); g_clip_s2c.total_bytes += new_data_len; if (data) { 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_debug("clipboard_xevent: event detected"); if (!g_clip_up) { return 1; } lxevent = (XEvent *)xevent; switch (lxevent->type) { case SelectionNotify: if (g_restrict_outbound_clipboard == 0) { clipboard_event_selection_notify(lxevent); } else { log_debug("outbound clipboard is restricted because of config"); return 1; } 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_debug("chansrv::clipboard_xevent: got UnmapNotify"); break; case ClientMessage: log_debug("chansrv::clipboard_xevent: got ClientMessage"); break; default: if (lxevent->type == g_xfixes_event_base + XFixesSetSelectionOwnerNotify) { log_debug("clipboard_xevent: got XFixesSetSelectionOwnerNotify"); clipboard_event_selection_owner_notify(lxevent); break; } if (lxevent->type == g_xfixes_event_base + XFixesSelectionWindowDestroyNotify) { log_debug("clipboard_xevent: got XFixesSelectionWindowDestroyNotify"); break; } if (lxevent->type == g_xfixes_event_base + XFixesSelectionClientCloseNotify) { log_debug("clipboard_xevent: got XFixesSelectionClientCloseNotify"); break; } /* we didn't handle this message */ return 1; } return 0; } xrdp-0.9.12/sesman/chansrv/chansrv_fuse.c000644 001751 001751 00000231020 13601643631 020265 0ustar00metameta000000 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] = ""; 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, 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) {} #else /****************************************************************************** ** ** ** when FUSE is enabled in xrdp ** ** ** ******************************************************************************/ #define FUSE_USE_VERSION 26 #include #include #include #include #include #include #include #include #include #include "arch.h" #include "os_calls.h" #include "clipboard_file.h" #include "chansrv_fuse.h" #include "chansrv_xfs.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 /* module based logging */ #define LOG_ERROR 0 #define LOG_INFO 1 #define LOG_DEBUG 2 #ifndef LOG_LEVEL #define LOG_LEVEL LOG_ERROR #endif #define log_error(_params...) \ { \ g_write("[%10.10u]: FUSE %s: %d : ERROR: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } #define log_always(_params...) \ { \ g_write("[%10.10u]: FUSE %s: %d : ALWAYS: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } #define log_info(_params...) \ { \ if (LOG_INFO <= LOG_LEVEL) \ { \ g_write("[%10.10u]: FUSE %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } #define log_debug(_params...) \ { \ if (LOG_DEBUG <= LOG_LEVEL) \ { \ g_write("[%10.10u]: FUSE %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } /* 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]; /* 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]; /* 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]; /* 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 */ }; 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; }; static char g_fuse_mount_name[256] = "xrdp_client"; static mode_t g_umask = 077; /* Umask for files in fs */ 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); /*****************************************************************************/ int load_fuse_config(void) { int index; char cfg_file[256]; struct list *items; struct list *values; char *item; char *value; items = list_create(); items->auto_free = 1; values = list_create(); values->auto_free = 1; g_snprintf(cfg_file, 255, "%s/sesman.ini", XRDP_CFG_PATH); file_by_name_read_section(cfg_file, "Chansrv", 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, "FuseMountName") == 0) { g_strncpy(g_fuse_mount_name, value, 255); } else if (g_strcasecmp(item, "FileUmask") == 0) { g_umask = strtol(value, NULL, 0); log_info("g_umask set to 0%o", g_umask); } } list_delete(items); list_delete(values); return 0; } /***************************************************************************** ** ** ** public functions - can be called from any code path ** ** ** *****************************************************************************/ /** * Initialize FUSE subsystem * * @return 0 on success, -1 on failure *****************************************************************************/ int xfuse_init(void) { struct fuse_args args = FUSE_ARGS_INIT(0, NULL); /* if already inited, just return */ if (g_xfuse_inited) { log_debug("already inited"); return 1; } if (g_ch != 0) { log_error("g_ch is not zero"); return -1; } load_fuse_config(); /* define FUSE mount point to ~/xrdp_client, ~/thinclient_drives */ g_snprintf(g_fuse_root_path, 255, "%s/%s", g_getenv("HOME"), g_fuse_mount_name); g_snprintf(g_fuse_clipboard_path, 255, "%s/.clipboard", g_fuse_root_path); /* if FUSE mount point does not exist, create it */ if (!g_directory_exist(g_fuse_root_path)) { if (!g_create_dir(g_fuse_root_path)) { log_error("mkdir %s failed. If %s is already mounted, you must " "first unmount it", g_fuse_root_path, 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_tcp_select(g_fd, 0) & 1) { 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_debug("xfs_add_entry() failed"); } else { 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_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_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_error("range error!"); return -1; } log_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_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_error("range error!"); return -1; } log_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_debug("entered: filename=%s flags=%d size=%d lindex=%d", filename, flags, size, lindex); /* 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_debug("failed to create file in xrdp filesystem"); return -1; } xinode->size = size; xinode->lindex = lindex; return 0; } /** * * * @return 0 on success, -1 on failure *****************************************************************************/ int xfuse_file_contents_size(int stream_id, int file_size) { log_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_error("fuse_parse_cmdline() failed"); fuse_opt_free_args(args); return -1; } if ((g_ch = fuse_mount(g_mount_point, args)) == 0) { log_error("fuse_mount() failed"); 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_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_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_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_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_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_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_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_debug("fip=%p IoStatus=0x%x", fip, IoStatus); /* * NT_STATUS_NO_SUCH_FILE is returned for empty directories */ if (IoStatus != NT_STATUS_SUCCESS && IoStatus != NT_STATUS_NO_SUCH_FILE) { int status; switch (IoStatus) { case NT_STATUS_ACCESS_DENIED: status = EACCES; break; default: status = ENOENT; } fuse_reply_err(fip->req, status); } else if (!xfs_get(g_xfs, fip->pinum)) { log_error("inode %ld is not valid", fip->pinum); fuse_reply_err(fip->req, ENOENT); } else { struct fuse_file_info *fi = &fip->fi; if ((fi->fh = (tintptr) xfs_opendir(g_xfs, fip->pinum)) == 0) { fuse_reply_err(fip->req, ENOMEM); } else { 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 != NT_STATUS_SUCCESS) { switch (IoStatus) { case NT_STATUS_SHARING_VIOLATION: /* This can happen when trying to read the attributes of * some system files (e.g. pagefile.sys) */ case NT_STATUS_ACCESS_DENIED: fuse_reply_err(fip->req, EACCES); break; case NT_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 NT_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_info("Error code %08x - fallthrough", (int) IoStatus); fuse_reply_err(fip->req, EIO); break; } } else if (!xfs_get(g_xfs, fip->pinum)) { log_error("parent inode %ld is not valid", fip->pinum); fuse_reply_err(fip->req, ENOENT); } else { log_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_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_debug("inode=%ld is open - " "preferring local attributes", xinode->inum); } else { log_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_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_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_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 != NT_STATUS_SUCCESS) { switch (IoStatus) { case NT_STATUS_SHARING_VIOLATION: /* This can happen when trying to read the attributes of * some system files (e.g. pagefile.sys) */ case NT_STATUS_ACCESS_DENIED: fuse_reply_err(fip->req, EACCES); break; case NT_STATUS_UNSUCCESSFUL: /* Happens if we try to lookup an illegal filename */ case NT_STATUS_NO_SUCH_FILE: fuse_reply_err(fip->req, ENOENT); break; default: log_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 NT_STATUS_ACCESS_DENIED: fuse_reply_err(fip->req, EACCES); break; case NT_STATUS_OBJECT_NAME_INVALID: case NT_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 = g_new0(XFUSE_HANDLE, 1)) != NULL) { /* save file handle for later use */ fh->DeviceId = DeviceId; fh->FileId = FileId; fip->fi.fh = (tintptr) fh; } } if ((fip->mode & S_IFREG) != 0 && fh == NULL) { /* We failed to allocate a file handle */ log_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_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 NT_STATUS_ACCESS_DENIED: fuse_reply_err(fip->req, EACCES); break; case NT_STATUS_OBJECT_NAME_INVALID: case NT_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 = g_new0(XFUSE_HANDLE, 1)) == NULL) { log_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 = (tintptr) fh; log_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, const char *buf, size_t length) { 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 != NT_STATUS_SUCCESS) { log_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_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 NT_STATUS_SUCCESS: case NT_STATUS_NO_SUCH_FILE: xfs_remove_entry(g_xfs, xinode->inum); /* Remove local copy */ fuse_reply_err(fip->req, 0); break; case NT_STATUS_SHARING_VIOLATION: case NT_STATUS_ACCESS_DENIED: fuse_reply_err(fip->req, EACCES); break; default: log_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 != NT_STATUS_SUCCESS) { status = (IoStatus == NT_STATUS_SHARING_VIOLATION) ? EBUSY : (IoStatus == NT_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); } /****************************************************************************** ** ** ** 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_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_error("inode %ld is not valid", parent); fuse_reply_err(req, ENOENT); } else { if (parent_xinode->device_id == 0) { /* 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_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_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_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_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_debug("req=%p ino=%ld", req, ino); /* if ino is not valid, just return */ if ((xino = xfs_get(g_xfs, ino)) == NULL) { log_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_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; struct xfs_dir_handle *dh; struct dirbuf1 b; log_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_error("inode %ld is not valid", ino); fuse_reply_err(req, ENOENT); } else if ((dh = (struct xfs_dir_handle *) fi->fh) == 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_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_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_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_debug("cannot rmdir; directory is not empty"); fuse_reply_err(req, ENOTEMPTY); } else if (xinode->device_id == 0) { /* specified file is a local resource */ //XFUSE_HANDLE *fh; log_debug("LK_TODO: this is still a TODO"); fuse_reply_err(req, EINVAL); } 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_error("system out of memory"); fuse_reply_err(req, ENOMEM); free(fip); free(full_path); } 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_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_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_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_error("inode %ld is not valid", new_parent); fuse_reply_err(req, EINVAL); } else if (!xfs_check_move_entry(g_xfs, old_xinode->inum, new_parent, new_name)) { fuse_reply_err(req, EINVAL); } else if (new_parent_xinode->device_id != old_xinode->device_id) { log_error("rename across file systems not supported"); fuse_reply_err(req, EINVAL); } else if (old_xinode->device_id == 0) { /* specified file is a local resource */ log_debug("LK_TODO: this is still a TODO"); fuse_reply_err(req, EINVAL); } 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_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_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_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 || (xinode = xfs_get(g_xfs, parent)) == NULL || (xinode->mode & S_IFDIR) == 0) { log_error("inode %ld is not valid", parent); fuse_reply_err(req, ENOENT); } else if (xinode->device_id == 0) { /* specified file is a local resource */ //XFUSE_HANDLE *fh; log_debug("LK_TODO: this is still a TODO"); fuse_reply_err(req, EINVAL); } 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_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_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_debug("entered: ino=%ld", ino); if (!(xinode = xfs_get(g_xfs, ino))) { log_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_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_debug("Invalid access mode specified"); fuse_reply_err(req, EINVAL); } else if (xinode->device_id == 0) { /* specified file is a local resource */ XFUSE_HANDLE *fh = g_new0(XFUSE_HANDLE, 1); fh->is_loc_resource = 1; fi->fh = (tintptr) 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_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_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 *) (tintptr) (fi->fh); log_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_error("inode %ld is not valid", ino); fuse_reply_err(req, ENOENT); } else if (xinode->device_id == 0) { /* 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_error("system out of memory"); fuse_reply_err(req, ENOMEM); return; } fip->req = req; fip->inum = ino; fip->fi = *fi; fi->fh = 0; /* * 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_error("failed to send devredir_close_file() cmd"); fuse_reply_err(req, EREMOTEIO); free(fip); } free(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_debug("want_bytes %zd bytes at off %lld", size, (long long) off); if ((fh = (XFUSE_HANDLE *)fi->fh) == NULL) { fuse_reply_err(req, EINVAL); } else if (fh->is_loc_resource) { /* target file is in .clipboard dir */ log_debug("target file is in .clipboard dir"); if ((xinode = xfs_get(g_xfs, ino)) == NULL) { log_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_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_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_debug("write %zd bytes at off %lld to inode=%ld", size, (long long) off, ino); if ((fh = (XFUSE_HANDLE *)fi->fh) == NULL) { log_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_debug("THIS IS STILL A TODO!"); fuse_reply_err(req, EINVAL); } else { /* target file is on a remote device */ fusep = g_new0(struct state_write, 1); if (fusep == NULL) { log_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_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_debug("#################### entered: ino=%ld datasync=%d", ino, datasync); log_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_debug("entered to_set=0x%x", to_set); if ((xinode = xfs_get(g_xfs, ino)) == NULL) { log_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_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->device_id == 0) { /* 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_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; log_debug("inode=%ld", ino); if ((xinode = xfs_get(g_xfs, ino)) == NULL) { log_error("inode %ld is not valid", ino); fuse_reply_err(req, ENOENT); } else if (xinode->device_id == 0) { if ((fi->fh = (tintptr) xfs_opendir(g_xfs, ino)) == 0) { fuse_reply_err(req, ENOMEM); } else { fuse_reply_open(req, fi); } } else { log_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_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_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) { struct xfs_dir_handle *dh = (struct xfs_dir_handle *) fi->fh; xfs_closedir(g_xfs, dh); 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_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_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) { free(result); result = NULL; } else { result = p; strcat(result, "/"); strcat(result, name); } } return result; } #endif /* end else #ifndef XRDP_FUSE */ xrdp-0.9.12/sesman/chansrv/ms-rdpefs.h000644 001751 001751 00000011016 13601643631 017505 0ustar00metameta000000 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 }; #endif /* MS_RDPEFS_H */ xrdp-0.9.12/sesman/chansrv/mlog.h000644 001751 001751 00000011005 13544635323 016546 0ustar00metameta000000 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. */ /* module based logging */ #ifndef _MLOG_H #define _MLOG_H /* * Note1: to enable debug messages, in your .c file, #define LOCAL_DEBUG * BEFORE including this file * * Note2: in your .c file, #define MODULE_NAME, 8 chars long, to print each * log entry with your module name */ #define LOG_ERROR 0 #define LOG_INFO 1 #define LOG_DEBUG_LOW 2 #define LOG_DEBUG_HIGH 3 #define LOG_LEVEL LOG_ERROR /* * print always */ #define log_error(_params...) \ do \ { \ g_write("[%10.10u]: %s %s: %d: ERROR: ", g_time3(), \ MODULE_NAME, __func__, __LINE__); \ g_writeln (_params); \ } \ while(0) #define log_always(_params...) \ do \ { \ g_write("[%10.10u]: %s %s: %d: ALWAYS: ", g_time3(), \ MODULE_NAME, __func__, __LINE__); \ g_writeln (_params); \ } \ while(0) /* * print conditionally */ #ifdef LOCAL_DEBUG #define log_info(_params...) \ do \ { \ if (LOG_INFO <= LOG_LEVEL) \ { \ g_write("[%10.10u]: %s %s: %d: INFO: ", g_time3(), \ MODULE_NAME, __func__, __LINE__); \ g_writeln (_params); \ } \ } \ while(0) #else #define log_info(_params...) #endif #ifdef LOCAL_DEBUG #define log_debug_low(_params...) \ do \ { \ if (LOG_DEBUG_LOW <= LOG_LEVEL) \ { \ g_write("[%10.10u]: %s %s: %d: DEBUG: ", g_time3(), \ MODULE_NAME, __func__, __LINE__); \ g_writeln (_params); \ } \ } \ while(0) #else #define log_debug_low(_params...) #endif #ifdef LOCAL_DEBUG #define log_debug_high(_params...) \ do \ { \ if (LOG_DEBUG_HIGH <= LOG_LEVEL) \ { \ g_write("[%10.10u]: %s %s: %d: DEBUG: ", g_time3(), \ MODULE_NAME, __func__, __LINE__); \ g_writeln (_params); \ } \ } \ while(0) #else #define log_debug_high(_params...) #endif #endif /* #ifndef _MLOG_H */ xrdp-0.9.12/sesman/chansrv/smartcard.h000644 001751 001751 00000014444 13544635323 017602 0ustar00metameta000000 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.9.12/sesman/chansrv/chansrv_common.c000644 001751 001751 00000004042 13544635323 020622 0ustar00metameta000000 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); 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) { /* rewind stream */ ls->p = ls->data; return 1; } return 0; } xrdp-0.9.12/sesman/chansrv/fifo.c000644 001751 001751 00000012707 13544635323 016540 0ustar00metameta000000 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. */ /* FIFO implementation to store a pointer to a user struct */ /* module based logging */ #if defined(HAVE_CONFIG_H) #include #endif #define MODULE_NAME "FIFO " #define LOCAL_DEBUG #include "fifo.h" #include "mlog.h" #include "os_calls.h" /** * Initialize a FIFO that grows as required * * @param fp pointer to a FIFO * @param num_entries initial size * * @return 0 on success, -1 on failure *****************************************************************************/ int fifo_init(FIFO* fp, int num_entries) { log_debug_high("entered"); /* validate params */ if (!fp) { log_debug_high("invalid parameters"); return -1; } if (num_entries < 1) num_entries = 10; fp->rd_ptr = 0; fp->wr_ptr = 0; fp->user_data = (long *) g_malloc(sizeof(long) * num_entries, 1); if (fp->user_data) { fp->entries = num_entries; log_debug_low("FIFO created; rd_ptr=%d wr_ptr=%d entries=%d", fp->rd_ptr, fp->wr_ptr, fp->entries); return 0; } else { log_error("FIFO create error; system out of memory"); fp->entries = 0; return -1; } } /** * Deinit FIFO and release resources * * @param fp FIFO to deinit * * @return 0 on success, -1 on error *****************************************************************************/ int fifo_deinit(FIFO* fp) { log_debug_high("entered"); if (!fp) { log_debug_high("FIFO is null"); return -1; } if (fp->user_data) { g_free(fp->user_data); fp->user_data = 0; } fp->rd_ptr = 0; fp->wr_ptr = 0; fp->entries = 0; return 0; } /** * Check if FIFO is empty * * @param fp FIFO * * @return 1 if FIFO is empty, 0 otherwise *****************************************************************************/ int fifo_is_empty(FIFO* fp) { log_debug_high("entered"); if (!fp) { log_debug_high("FIFO is null"); return 0; } return (fp->rd_ptr == fp->wr_ptr) ? 1 : 0; } /** * Insert an item at the end * * @param fp FIFO * @param data data to insert into FIFO * * @param 0 on success, -1 on error *****************************************************************************/ int fifo_insert(FIFO* fp, void* data) { long* lp; int next_val; /* next value for wr_ptr */ int i; log_debug_high("entered"); if (!fp) { log_debug_high("FIFO is null"); return -1; } next_val = fp->wr_ptr + 1; if (next_val >= fp->entries) next_val = 0; if (next_val == fp->rd_ptr) { /* FIFO is full, expand it by 10 entries */ lp = (long *) g_malloc(sizeof(long) * (fp->entries + 10), 1); if (!lp) { log_debug_low("FIFO full; cannot expand, no memory"); return -1; } log_debug_low("FIFO full, expanding by 10 entries"); /* copy old data new location */ for (i = 0; i < (fp->entries - 1); i++) { lp[i] = fp->user_data[fp->rd_ptr++]; if (fp->rd_ptr >= fp->entries) fp->rd_ptr = 0; } /* update pointers */ fp->rd_ptr = 0; fp->wr_ptr = fp->entries - 1; next_val = fp->entries; fp->entries += 10; /* free old data */ g_free(fp->user_data); fp->user_data = lp; } log_debug_low("inserting data at index %d", fp->wr_ptr); fp->user_data[fp->wr_ptr] = (long) data; fp->wr_ptr = next_val; return 0; } /** * Remove an item from the head * * @param fp FIFO * * @param data on success, NULL on error *****************************************************************************/ void* fifo_remove(FIFO* fp) { long data; log_debug_high("entered"); if (!fp) { log_debug_high("FIFO is null"); return 0; } if (fp->rd_ptr == fp->wr_ptr) { log_debug_high("FIFO is empty"); return 0; } log_debug_low("removing data at index %d", fp->rd_ptr); data = fp->user_data[fp->rd_ptr++]; if (fp->rd_ptr >= fp->entries) { log_debug_high("FIFO rd_ptr wrapped around"); fp->rd_ptr = 0; } return (void *) data; } /** * Return item from head, but do not remove it * * @param fp FIFO * * @param data on success, NULL on error *****************************************************************************/ void* fifo_peek(FIFO* fp) { log_debug_high("entered"); if (!fp) { log_debug_high("FIFO is null"); return 0; } if (fp->rd_ptr == fp->wr_ptr) { log_debug_high("FIFO is empty"); return 0; } log_debug_low("peeking data at index %d", fp->rd_ptr); return (void *) fp->user_data[fp->rd_ptr]; } xrdp-0.9.12/sesman/chansrv/irp.c000644 001751 001751 00000016454 13601643631 016405 0ustar00metameta000000 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 "parse.h" #include "os_calls.h" #include "irp.h" /* module based logging */ #define LOG_ERROR 0 #define LOG_INFO 1 #define LOG_DEBUG 2 #ifndef LOG_LEVEL #define LOG_LEVEL LOG_ERROR #endif #define log_error(_params...) \ { \ g_write("[%10.10u]: IRP %s: %d : ERROR: ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } #define log_info(_params...) \ { \ if (LOG_INFO <= LOG_LEVEL) \ { \ g_write("[%10.10u]: IRP %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } #define log_debug(_params...) \ { \ if (LOG_DEBUG <= LOG_LEVEL) \ { \ g_write("[%10.10u]: IRP %s: %d : ", \ g_time3(), __func__, __LINE__); \ g_writeln (_params); \ } \ } 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_debug("entered"); /* create new IRP */ irp = g_new0(IRP, 1); if (irp == NULL) { log_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_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_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_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_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_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_debug("returning irp=%p", irp); return irp; } irp = irp->next; } log_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_debug("returning irp=%p", irp); return irp; } irp = irp->next; } log_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_debug("returning irp=%p", irp); return irp; } void devredir_irp_dump(void) { IRP *irp = g_irp_head; log_debug("------- dumping IRPs --------"); while (irp) { log_debug(" completion_id=%d\tcompletion_type=%d\tFileId=%d", irp->CompletionId, irp->completion_type, irp->FileId); irp = irp->next; } log_debug("------- dumping IRPs done ---"); } xrdp-0.9.12/sesman/chansrv/pcsc/.gitignore000644 001751 001751 00000000012 13544635323 020353 0ustar00metameta000000 000000 !Makefile xrdp-0.9.12/sesman/chansrv/pcsc/dumps/000755 001751 001751 00000000000 13544635323 017522 5ustar00metameta000000 000000 xrdp-0.9.12/sesman/chansrv/pcsc/xrdp_pcsc.c000644 001751 001751 00000116017 13544635323 020531 0ustar00metameta000000 000000 #include #include #include #include #include #include #include #include #include #include #include #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 get_display_num_from_display(const char *display_text) { int rv; int index; int mode; int host_index; int disp_index; int scre_index; char host[256]; char disp[256]; char scre[256]; memset(host, 0, 256); memset(disp, 0, 256); memset(scre, 0, 256); index = 0; host_index = 0; disp_index = 0; scre_index = 0; mode = 0; while (display_text[index] != 0) { if (display_text[index] == ':') { mode = 1; } else if (display_text[index] == '.') { mode = 2; } else if (mode == 0) { host[host_index] = display_text[index]; host_index++; } else if (mode == 1) { disp[disp_index] = display_text[index]; disp_index++; } else if (mode == 2) { scre[scre_index] = display_text[index]; scre_index++; } index++; } host[host_index] = 0; disp[disp_index] = 0; scre[scre_index] = 0; LLOGLN(10, ("get_display_num_from_display: host [%s] disp [%s] scre [%s]", host, disp, scre)); rv = atoi(disp); return rv; } /*****************************************************************************/ 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 = get_display_num_from_display(xrdp_display); if (dis < 10) { /* DISPLAY must be > 9 */ LLOGLN(0, ("connect_to_chansrv: error, display not > 9 %d", dis)); 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 max; int lcode; struct timeval time; fd_set rd_set; LLOGLN(10, ("get_message:")); max = g_sck + 1; while (1) { LLOGLN(10, ("get_message: loop")); time.tv_sec = 1; time.tv_usec = 0; FD_ZERO(&rd_set); FD_SET(((unsigned int)g_sck), &rd_set); error = select(max, &rd_set, 0, 0, &time); if (error == 1) { pthread_mutex_lock(&g_mutex); time.tv_sec = 0; time.tv_usec = 0; FD_ZERO(&rd_set); FD_SET(((unsigned int)g_sck), &rd_set); error = select(max, &rd_set, 0, 0, &time); 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; // TODO figure out why recv pci does not work if (1 || (pioRecvPci == 0) || (pioRecvPci->cbPciLength < 8)) { 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 { got_recv_pci = 1; 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 bytes_groups; 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; bytes_groups = 0; if (mszGroups != 0) { bytes_groups = strlen(mszGroups); } SET_UINT32(msg, offset, bytes_groups); offset += 4; memcpy(msg + offset, mszGroups, bytes_groups); offset += bytes_groups; 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.9.12/sesman/chansrv/pcsc/Makefile000644 001751 001751 00000000266 13544635323 020036 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/wrapper/000755 001751 001751 00000000000 13544635323 020052 5ustar00metameta000000 000000 xrdp-0.9.12/sesman/chansrv/pcsc/wrapper/winscard-funcs.h000755 001751 001751 00000017516 13544635323 023166 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/wrapper/winscard.def000755 001751 001751 00000002051 13544635323 022345 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/wrapper/Makefile000755 001751 001751 00000000232 13544635323 021512 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/wrapper/winscard.c000755 001751 001751 00000071570 13544635323 022045 0ustar00metameta000000 000000 #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; char text[8148]; 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.9.12/sesman/chansrv/pcsc/wrapper/winscard-func-names.txt000755 001751 001751 00000003156 13544635323 024467 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-status.txt000644 001751 001751 00000017216 13544635323 022707 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-release-context.txt000644 001751 001751 00000001053 13544635323 024456 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-connect.txt000644 001751 001751 00000003466 13544635323 023017 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-disconnect.txt000644 001751 001751 00000002610 13544635323 023505 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-list-readers.txt000644 001751 001751 00000013535 13544635323 023762 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-control.txt000644 001751 001751 00000007437 13544635323 023050 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-establish-context.txt000644 001751 001751 00000002171 13544635323 025016 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-get-status-change.txt000644 001751 001751 00000003137 13544635323 024704 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-end-tranaction.txt000644 001751 001751 00000004127 13544635323 024267 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-transmit.txt000644 001751 001751 00000003722 13544635323 023222 0ustar00metameta000000 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.9.12/sesman/chansrv/pcsc/dumps/scard-begin-tranaction.txt000644 001751 001751 00000001312 13544635323 024576 0ustar00metameta000000 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.9.12/sesman/libscp/libscp_lock.h000644 001751 001751 00000002745 13544635323 017717 0ustar00metameta000000 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. */ #ifndef LIBSCP_LOCK_H #define LIBSCP_LOCK_H #include "libscp_types.h" #define LIBSCP_LOCK_FORK_BLOCKER 1 #define LIBSCP_LOCK_FORK_WAITING 0 /** * * @brief initializes all the locks * */ void scp_lock_init(void); /** * * @brief requires to fork a new child process * */ void scp_lock_fork_request(void); /** * * @brief releases a fork() request * */ void scp_lock_fork_release(void); /** * * @brief starts a section that is critical for forking * * starts a section that is critical for forking, that is no one can fork() * while I'm in a critical section. But if someone wanted to fork we have * to wait until he finishes with lock_fork_release() * * @return * */ int scp_lock_fork_critical_section_start(void); /** * * @brief closes the critical section * */ void scp_lock_fork_critical_section_end(int blocking); #endif xrdp-0.9.12/sesman/libscp/libscp_commands_mng.h000644 001751 001751 00000002125 13544635323 021421 0ustar00metameta000000 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 libscp_commands_mng.h * @brief libscp data types definitions * @author Simone Fedele * */ #ifndef LIBSCP_COMMANDS_MNG_H #define LIBSCP_COMMANDS_MNG_H #define SCP_CMD_MNG_LOGIN 0x0001 #define SCP_CMD_MNG_LOGIN_ALLOW 0x0002 #define SCP_CMD_MNG_LOGIN_DENY 0x0003 #define SCP_CMD_MNG_CMD_ERROR 0x0004 #define SCP_CMD_MNG_LIST_REQ 0x0005 #define SCP_CMD_MNG_LIST 0x0006 #define SCP_CMD_MNG_ACTION 0x0007 #endif xrdp-0.9.12/sesman/libscp/libscp.h000644 001751 001751 00000002137 13544635323 016702 0ustar00metameta000000 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 libscp.h * @brief libscp main header * @author Simone Fedele * */ #ifndef LIBSCP_H #define LIBSCP_H #include "libscp_types.h" #include "libscp_commands.h" #include "libscp_connection.h" #include "libscp_session.h" #include "libscp_init.h" #include "libscp_tcp.h" #include "libscp_lock.h" #include "libscp_vX.h" #include "libscp_v0.h" #include "libscp_v1s.h" #include "libscp_v1c.h" #include "libscp_v1s_mng.h" #include "libscp_v1c_mng.h" #endif xrdp-0.9.12/sesman/libscp/libscp_types_mng.h000644 001751 001751 00000002015 13544635323 020762 0ustar00metameta000000 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 libscp_types_mng.h * @brief libscp data types definitions * @author Simone Fedele * */ #ifndef LIBSCP_TYPES_MNG_H #define LIBSCP_TYPES_MNG_H #include "os_calls.h" #include "parse.h" #include "arch.h" #include "log.h" enum SCP_MNG_COMMAND { SCP_MNG_CMD_KILL, SCP_MNG_CMD_DISCONNECT }; struct SCP_MNG_DATA { enum SCP_MNG_COMMAND cmd; SCP_SID sid; }; #endif xrdp-0.9.12/sesman/libscp/libscp_connection.c000644 001751 001751 00000002675 13544635323 021123 0ustar00metameta000000 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 libscp_connection.c * @brief SCP_CONNECTION handling code * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "libscp_connection.h" //extern struct log_config* s_log; struct SCP_CONNECTION * scp_connection_create(int sck) { struct SCP_CONNECTION *conn; conn = g_new(struct SCP_CONNECTION, 1); if (0 == conn) { log_message(LOG_LEVEL_ERROR, "[connection:%d] connection create: malloc error", __LINE__); return 0; } conn->in_sck = sck; make_stream(conn->in_s); init_stream(conn->in_s, 8196); make_stream(conn->out_s); init_stream(conn->out_s, 8196); return conn; } void scp_connection_destroy(struct SCP_CONNECTION *c) { free_stream(c->in_s); free_stream(c->out_s); g_free(c); } xrdp-0.9.12/sesman/libscp/libscp_v1c.c000644 001751 001751 00000031063 13544635323 017446 0ustar00metameta000000 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 libscp_v1c.c * @brief libscp version 1 client api code * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "libscp_v1c.h" #include #include static enum SCP_CLIENT_STATES_E _scp_v1c_check_response(struct SCP_CONNECTION *c, struct SCP_SESSION *s); /* client API */ /* 001 */ enum SCP_CLIENT_STATES_E scp_v1c_connect(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { tui8 sz; tui32 size; init_stream(c->out_s, c->out_s->size); init_stream(c->in_s, c->in_s->size); size = 19 + 17 + 4 + g_strlen(s->hostname) + g_strlen(s->username) + g_strlen(s->password); if (s->addr_type == SCP_ADDRESS_TYPE_IPV4) { size = size + 4; } else { size = size + 16; } /* sending request */ /* header */ out_uint32_be(c->out_s, 1); /* version */ out_uint32_be(c->out_s, size); out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); out_uint16_be(c->out_s, 1); /* body */ out_uint8(c->out_s, s->type); out_uint16_be(c->out_s, s->height); out_uint16_be(c->out_s, s->width); out_uint8(c->out_s, s->bpp); out_uint8(c->out_s, s->rsr); out_uint8p(c->out_s, s->locale, 17); out_uint8(c->out_s, s->addr_type); if (s->addr_type == SCP_ADDRESS_TYPE_IPV4) { out_uint32_be(c->out_s, s->ipv4addr); } else if (s->addr_type == SCP_ADDRESS_TYPE_IPV6) { out_uint8p(c->out_s, s->ipv6addr, 16); } sz = g_strlen(s->hostname); out_uint8(c->out_s, sz); out_uint8p(c->out_s, s->hostname, sz); sz = g_strlen(s->username); out_uint8(c->out_s, sz); out_uint8p(c->out_s, s->username, sz); sz = g_strlen(s->password); out_uint8(c->out_s, sz); out_uint8p(c->out_s, s->password, sz); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { return SCP_CLIENT_STATE_NETWORK_ERR; } /* wait for response */ return _scp_v1c_check_response(c, s); } /* 004 */ enum SCP_CLIENT_STATES_E scp_v1c_resend_credentials(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { tui8 sz; tui32 size; init_stream(c->out_s, c->out_s->size); init_stream(c->in_s, c->in_s->size); size = 12 + 2 + g_strlen(s->username) + g_strlen(s->password); /* sending request */ /* header */ out_uint32_be(c->out_s, 1); /* version */ out_uint32_be(c->out_s, size); out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); out_uint16_be(c->out_s, 4); /* body */ sz = g_strlen(s->username); out_uint8(c->out_s, sz); out_uint8p(c->out_s, s->username, sz); sz = g_strlen(s->password); out_uint8(c->out_s, sz); out_uint8p(c->out_s, s->password, sz); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { return SCP_CLIENT_STATE_NETWORK_ERR; } /* wait for response */ return _scp_v1c_check_response(c, s); } /* 041 */ enum SCP_CLIENT_STATES_E scp_v1c_get_session_list(struct SCP_CONNECTION *c, int *scount, struct SCP_DISCONNECTED_SESSION **s) { tui32 version = 1; tui32 size = 12; tui16 cmd = 41; tui32 sescnt = 0; /* total session number */ tui32 sestmp = 0; /* additional total session number */ tui8 pktcnt = 0; /* packet session count */ tui32 totalcnt = 0; /* session counter */ tui8 continued = 0; /* continue flag */ int firstpkt = 1; /* "first packet" flag */ int idx; struct SCP_DISCONNECTED_SESSION *ds = 0; init_stream(c->out_s, c->out_s->size); /* we request session list */ out_uint32_be(c->out_s, version); /* version */ out_uint32_be(c->out_s, size); /* size */ out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); /* cmdset */ out_uint16_be(c->out_s, cmd); /* cmd */ if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { return SCP_CLIENT_STATE_NETWORK_ERR; } do { /* then we wait for server response */ init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { g_free(ds); return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version != 1) { g_free(ds); return SCP_CLIENT_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); if (size < 12) { g_free(ds); return SCP_CLIENT_STATE_SIZE_ERR; } init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8)) { g_free(ds); return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != SCP_COMMAND_SET_DEFAULT) { g_free(ds); return SCP_CLIENT_STATE_SEQUENCE_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != 42) { g_free(ds); return SCP_CLIENT_STATE_SEQUENCE_ERR; } if (firstpkt) { firstpkt = 0; in_uint32_be(c->in_s, sescnt); sestmp = sescnt; ds = g_new(struct SCP_DISCONNECTED_SESSION, sescnt); if (ds == 0) { return SCP_CLIENT_STATE_INTERNAL_ERR; } } else { in_uint32_be(c->in_s, sestmp); } in_uint8(c->in_s, continued); in_uint8(c->in_s, pktcnt); for (idx = 0; idx < pktcnt; idx++) { in_uint32_be(c->in_s, (ds[totalcnt]).SID); /* session id */ in_uint8(c->in_s, (ds[totalcnt]).type); in_uint16_be(c->in_s, (ds[totalcnt]).height); in_uint16_be(c->in_s, (ds[totalcnt]).width); in_uint8(c->in_s, (ds[totalcnt]).bpp); in_uint8(c->in_s, (ds[totalcnt]).idle_days); in_uint8(c->in_s, (ds[totalcnt]).idle_hours); in_uint8(c->in_s, (ds[totalcnt]).idle_minutes); in_uint16_be(c->in_s, (ds[totalcnt]).conn_year); in_uint8(c->in_s, (ds[totalcnt]).conn_month); in_uint8(c->in_s, (ds[totalcnt]).conn_day); in_uint8(c->in_s, (ds[totalcnt]).conn_hour); in_uint8(c->in_s, (ds[totalcnt]).conn_minute); in_uint8(c->in_s, (ds[totalcnt]).addr_type); if ((ds[totalcnt]).addr_type == SCP_ADDRESS_TYPE_IPV4) { in_uint32_be(c->in_s, (ds[totalcnt]).ipv4addr); } else if ((ds[totalcnt]).addr_type == SCP_ADDRESS_TYPE_IPV6) { in_uint8a(c->in_s, (ds[totalcnt]).ipv6addr, 16); } totalcnt++; } } while (continued); printf("fine\n"); /* return data... */ (*scount) = sescnt; (*s) = ds; return SCP_CLIENT_STATE_LIST_OK; } /* 043 */ enum SCP_CLIENT_STATES_E scp_v1c_select_session(struct SCP_CONNECTION *c, struct SCP_SESSION *s, SCP_SID sid) { tui32 version = 1; tui32 size = 16; tui16 cmd = 43; init_stream(c->out_s, c->out_s->size); /* sending our selection */ out_uint32_be(c->out_s, version); /* version */ out_uint32_be(c->out_s, size); /* size */ out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); /* cmdset */ out_uint16_be(c->out_s, cmd); /* cmd */ out_uint32_be(c->out_s, sid); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { return SCP_CLIENT_STATE_NETWORK_ERR; } /* waiting for response.... */ init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version != 1) { return SCP_CLIENT_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); if (size < 12) { return SCP_CLIENT_STATE_SIZE_ERR; } init_stream(c->in_s, c->in_s->size); /* read the rest of the packet */ if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8)) { return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != SCP_COMMAND_SET_DEFAULT) { return SCP_CLIENT_STATE_SEQUENCE_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != 46) { return SCP_CLIENT_STATE_SEQUENCE_ERR; } /* session display */ in_uint16_be(c->in_s, (s->display)); /*we don't need to return any data other than the display */ /*because we already sent that */ return SCP_CLIENT_STATE_OK; } /* 044 */ enum SCP_CLIENT_STATES_E scp_v1c_select_session_cancel(struct SCP_CONNECTION *c) { tui32 version = 1; tui32 size = 12; tui16 cmd = 44; init_stream(c->out_s, c->out_s->size); /* sending our selection */ out_uint32_be(c->out_s, version); /* version */ out_uint32_be(c->out_s, size); /* size */ out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); /* cmdset */ out_uint16_be(c->out_s, cmd); /* cmd */ if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { return SCP_CLIENT_STATE_NETWORK_ERR; } return SCP_CLIENT_STATE_END; } static enum SCP_CLIENT_STATES_E _scp_v1c_check_response(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { tui32 version; tui32 size; tui16 cmd; tui16 dim; init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version != 1) { return SCP_CLIENT_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); init_stream(c->in_s, c->in_s->size); /* read the rest of the packet */ if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8)) { return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != SCP_COMMAND_SET_DEFAULT) { return SCP_CLIENT_STATE_SEQUENCE_ERR; } in_uint16_be(c->in_s, cmd); if (cmd == 2) /* connection denied */ { in_uint16_be(c->in_s, dim); if (s->errstr != 0) { g_free(s->errstr); } s->errstr = g_new(char, dim + 1); if (s->errstr == 0) { return SCP_CLIENT_STATE_INTERNAL_ERR; } in_uint8a(c->in_s, s->errstr, dim); (s->errstr)[dim] = '\0'; return SCP_CLIENT_STATE_CONNECTION_DENIED; } else if (cmd == 3) /* resend usr/pwd */ { in_uint16_be(c->in_s, dim); if (s->errstr != 0) { g_free(s->errstr); } s->errstr = g_new(char, dim + 1); if (s->errstr == 0) { return SCP_CLIENT_STATE_INTERNAL_ERR; } in_uint8a(c->in_s, s->errstr, dim); (s->errstr)[dim] = '\0'; return SCP_CLIENT_STATE_RESEND_CREDENTIALS; } else if (cmd == 20) /* password change */ { in_uint16_be(c->in_s, dim); if (s->errstr != 0) { g_free(s->errstr); } s->errstr = g_new(char, dim + 1); if (s->errstr == 0) { return SCP_CLIENT_STATE_INTERNAL_ERR; } in_uint8a(c->in_s, s->errstr, dim); (s->errstr)[dim] = '\0'; return SCP_CLIENT_STATE_PWD_CHANGE_REQ; } else if (cmd == 30) /* display */ { in_uint16_be(c->in_s, s->display); return SCP_CLIENT_STATE_OK; } //else if (cmd == 31) /* there's a disconnected session */ //{ // return SCP_CLIENT_STATE_RECONNECT_SINGLE; //} //else if (cmd == 33) /* display of a disconnected session */ //{ // return SCP_CLIENT_STATE_RECONNECT; //} else if (cmd == 40) /* session list */ { return SCP_CLIENT_STATE_SESSION_LIST; } return SCP_CLIENT_STATE_SEQUENCE_ERR; } xrdp-0.9.12/sesman/libscp/libscp_v1c_mng.c000644 001751 001751 00000027735 13544635323 020322 0ustar00metameta000000 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 libscp_v1c_mng.c * @brief libscp version 1 client api code - session management * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "libscp_v1c_mng.h" #include #include //extern struct log_config* s_log; static enum SCP_CLIENT_STATES_E _scp_v1c_mng_check_response(struct SCP_CONNECTION *c, struct SCP_SESSION *s); /* client API */ /* 001 */ enum SCP_CLIENT_STATES_E scp_v1c_mng_connect(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { tui8 sz; tui32 size; init_stream(c->out_s, c->out_s->size); init_stream(c->in_s, c->in_s->size); size = 12 + 4 + g_strlen(s->hostname) + g_strlen(s->username) + g_strlen(s->password); if (s->addr_type == SCP_ADDRESS_TYPE_IPV4) { size = size + 4; } else { size = size + 16; } /* sending request */ /* header */ out_uint32_be(c->out_s, 1); /* version */ out_uint32_be(c->out_s, size); out_uint16_be(c->out_s, SCP_COMMAND_SET_MANAGE); out_uint16_be(c->out_s, SCP_CMD_MNG_LOGIN); /* data */ sz = g_strlen(s->username); out_uint8(c->out_s, sz); out_uint8p(c->out_s, s->username, sz); sz = g_strlen(s->password); out_uint8(c->out_s, sz); out_uint8p(c->out_s, s->password, sz); /* address */ out_uint8(c->out_s, s->addr_type); if (s->addr_type == SCP_ADDRESS_TYPE_IPV4) { out_uint32_be(c->out_s, s->ipv4addr); } else { out_uint8p(c->out_s, s->ipv6addr, 16); } /* hostname */ sz = g_strlen(s->hostname); out_uint8(c->out_s, sz); out_uint8p(c->out_s, s->hostname, sz); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: network error", __LINE__); return SCP_CLIENT_STATE_NETWORK_ERR; } /* wait for response */ return _scp_v1c_mng_check_response(c, s); } /* 004 */ enum SCP_CLIENT_STATES_E scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount, struct SCP_DISCONNECTED_SESSION **s) { tui32 version = 1; tui32 size = 12; tui16 cmd = SCP_CMD_MNG_LIST_REQ; /* request session list */ tui32 sescnt = 0; /* total session number */ tui32 sestmp = 0; /* additional total session number */ tui8 pktcnt = 0; /* packet session count */ tui32 totalcnt = 0; /* session counter */ tui8 continued = 0; /* continue flag */ int firstpkt = 1; /* "first packet" flag */ int idx; struct SCP_DISCONNECTED_SESSION *ds = 0; // tui8 addr[16]; init_stream(c->out_s, c->out_s->size); /* we request session list */ out_uint32_be(c->out_s, version); /* version */ out_uint32_be(c->out_s, size); /* size */ out_uint16_be(c->out_s, SCP_COMMAND_SET_MANAGE); /* cmdset */ out_uint16_be(c->out_s, cmd); /* cmd */ if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: network error", __LINE__); return SCP_CLIENT_STATE_NETWORK_ERR; } do { /* then we wait for server response */ init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: network error", __LINE__); g_free(ds); return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version != 1) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: version error", __LINE__); g_free(ds); return SCP_CLIENT_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); if (size < 12) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: size error", __LINE__); g_free(ds); return SCP_CLIENT_STATE_SIZE_ERR; } init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8)) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: network error", __LINE__); g_free(ds); return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != SCP_COMMAND_SET_MANAGE) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: sequence error", __LINE__); g_free(ds); return SCP_CLIENT_STATE_SEQUENCE_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != SCP_CMD_MNG_LIST) /* session list */ { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: sequence error", __LINE__); g_free(ds); return SCP_CLIENT_STATE_SEQUENCE_ERR; } if (firstpkt) { firstpkt = 0; in_uint32_be(c->in_s, sescnt); sestmp = sescnt; if (0 == sescnt) { /* return data... */ (*scount) = sescnt; (*s) = NULL; LOG_DBG("[v1c_mng] end list - no session on TS"); return SCP_CLIENT_STATE_LIST_OK; } ds = g_new(struct SCP_DISCONNECTED_SESSION, sescnt); if (ds == 0) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: internal error", __LINE__); return SCP_CLIENT_STATE_INTERNAL_ERR; } } else { in_uint32_be(c->in_s, sestmp); } in_uint8(c->in_s, continued); in_uint8(c->in_s, pktcnt); for (idx = 0; idx < pktcnt; idx++) { in_uint32_be(c->in_s, (ds[totalcnt]).SID); /* session id */ in_uint8(c->in_s, (ds[totalcnt]).type); in_uint16_be(c->in_s, (ds[totalcnt]).height); in_uint16_be(c->in_s, (ds[totalcnt]).width); in_uint8(c->in_s, (ds[totalcnt]).bpp); in_uint8(c->in_s, (ds[totalcnt]).idle_days); in_uint8(c->in_s, (ds[totalcnt]).idle_hours); in_uint8(c->in_s, (ds[totalcnt]).idle_minutes); in_uint16_be(c->in_s, (ds[totalcnt]).conn_year); in_uint8(c->in_s, (ds[totalcnt]).conn_month); in_uint8(c->in_s, (ds[totalcnt]).conn_day); in_uint8(c->in_s, (ds[totalcnt]).conn_hour); in_uint8(c->in_s, (ds[totalcnt]).conn_minute); in_uint8(c->in_s, (ds[totalcnt]).addr_type); if ((ds[totalcnt]).addr_type == SCP_ADDRESS_TYPE_IPV4) { in_uint32_be(c->in_s, (ds[totalcnt]).ipv4addr); } if ((ds[totalcnt]).addr_type == SCP_ADDRESS_TYPE_IPV6) { in_uint8a(c->in_s, (ds[totalcnt]).ipv6addr, 16); } totalcnt++; } } while (continued); /* return data... */ (*scount) = sescnt; (*s) = ds; LOG_DBG("[v1c_mng] end list"); return SCP_CLIENT_STATE_LIST_OK; } /* 043 * / enum SCP_CLIENT_STATES_E scp_v1c_select_session(struct SCP_CONNECTION* c, struct SCP_SESSION* s, SCP_SID sid) { tui32 version = 1; tui32 size = 16; tui16 cmd = 43; init_stream(c->out_s, c->out_s->size); / * sending our selection * / out_uint32_be(c->out_s, version); / * version * / out_uint32_be(c->out_s, size); / * size * / out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); / * cmdset * / out_uint16_be(c->out_s, cmd); / * cmd * / out_uint32_be(c->out_s, sid); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { return SCP_CLIENT_STATE_NETWORK_ERR; } / * waiting for response.... * / init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version != 1) { return SCP_CLIENT_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); if (size < 12) { return SCP_CLIENT_STATE_SIZE_ERR; } init_stream(c->in_s, c->in_s->size); / * read the rest of the packet * / if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8)) { return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != SCP_COMMAND_SET_DEFAULT) { return SCP_CLIENT_STATE_SEQUENCE_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != 46) { return SCP_CLIENT_STATE_SEQUENCE_ERR; } / * session display * / in_uint16_be(c->in_s, (s->display)); / *we don't need to return any data other than the display * / / *because we already sent that * / return SCP_CLIENT_STATE_OK; }*/ /* 044 * / enum SCP_CLIENT_STATES_E scp_v1c_select_session_cancel(struct SCP_CONNECTION* c) { tui32 version = 1; tui32 size = 12; tui16 cmd = 44; init_stream(c->out_s, c->out_s->size); / * sending our selection * / out_uint32_be(c->out_s, version); / * version * / out_uint32_be(c->out_s, size); / * size * / out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); / * cmdset * / out_uint16_be(c->out_s, cmd); / * cmd * / if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { return SCP_CLIENT_STATE_NETWORK_ERR; } return SCP_CLIENT_STATE_END; }*/ static enum SCP_CLIENT_STATES_E _scp_v1c_mng_check_response(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { tui32 version; tui32 size; tui16 cmd; tui8 dim; char buf[257]; init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: network error", __LINE__); return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version != 1) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: version error", __LINE__); return SCP_CLIENT_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); init_stream(c->in_s, c->in_s->size); /* read the rest of the packet */ if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8)) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: network error", __LINE__); return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != SCP_COMMAND_SET_MANAGE) { log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: sequence error", __LINE__); return SCP_CLIENT_STATE_SEQUENCE_ERR; } in_uint16_be(c->in_s, cmd); if (cmd == SCP_CMD_MNG_LOGIN_ALLOW) /* connection ok */ { log_message(LOG_LEVEL_INFO, "[v1c_mng:%d] connection ok", __LINE__); return SCP_CLIENT_STATE_OK; } else if (cmd == SCP_CMD_MNG_LOGIN_DENY) /* connection denied */ { in_uint8(c->in_s, dim); buf[dim] = '\0'; in_uint8a(c->in_s, buf, dim); scp_session_set_errstr(s, buf); log_message(LOG_LEVEL_INFO, "[v1c_mng:%d] connection denied: %s", __LINE__ , s->errstr); return SCP_CLIENT_STATE_CONNECTION_DENIED; } log_message(LOG_LEVEL_WARNING, "[v1c-mng:%d] connection aborted: sequence error", __LINE__); return SCP_CLIENT_STATE_SEQUENCE_ERR; } xrdp-0.9.12/sesman/libscp/libscp_vX.c000644 001751 001751 00000002513 13544635323 017350 0ustar00metameta000000 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 libscp_vX.c * @brief libscp version neutral code * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "libscp_vX.h" /* server API */ enum SCP_SERVER_STATES_E scp_vXs_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s) { tui32 version; /* reading version and packet size */ if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { return SCP_SERVER_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version == 0) { return scp_v0s_accept(c, s, 1); } else if (version == 1) { return scp_v1s_accept(c, s, 1); } return SCP_SERVER_STATE_VERSION_ERR; } xrdp-0.9.12/sesman/libscp/libscp_init.c000644 001751 001751 00000002074 13544635323 017720 0ustar00metameta000000 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 libscp_init.c * @brief libscp initialization code * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "libscp_init.h" //struct log_config* s_log; /* server API */ int scp_init(void) { /* if (0 == log) { return 1; } */ //s_log = log; scp_lock_init(); log_message(LOG_LEVEL_DEBUG, "libscp initialized"); return 0; } xrdp-0.9.12/sesman/libscp/libscp_v1s.h000644 001751 001751 00000004732 13544635323 017476 0ustar00metameta000000 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 libscp_v1s.h * @brief libscp version 1 server api declarations * @author Simone Fedele * */ #ifndef LIBSCP_V1S_H #define LIBSCP_V1S_H #include "libscp.h" /* server API */ /** * * @brief processes the stream using scp version 1 * @param c connection descriptor * @param s pointer to session descriptor pointer * @param skipVchk if set to !0 skips the version control (to be used after * scp_vXs_accept() ) * * this function places in *s the address of a newly allocated SCP_SESSION structure * that should be free()d */ enum SCP_SERVER_STATES_E scp_v1s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk); /** * * @brief denies connection to sesman * @param c connection descriptor * @param reason pointer to a string containing the reason for denying connection * */ /* 002 */ enum SCP_SERVER_STATES_E scp_v1s_deny_connection(struct SCP_CONNECTION* c, const char *reason); enum SCP_SERVER_STATES_E scp_v1s_request_password(struct SCP_CONNECTION* c, struct SCP_SESSION* s, const char *reason); /* 020 */ enum SCP_SERVER_STATES_E scp_v1s_request_pwd_change(struct SCP_CONNECTION* c, char* reason, char* npw); /* 023 */ enum SCP_SERVER_STATES_E scp_v1s_pwd_change_error(struct SCP_CONNECTION* c, char* error, int retry, char* npw); /* 030 */ enum SCP_SERVER_STATES_E scp_v1s_connect_new_session(struct SCP_CONNECTION* c, SCP_DISPLAY d); /* 032 */ enum SCP_SERVER_STATES_E scp_v1s_connection_error(struct SCP_CONNECTION* c, const char *error); /* 040 */ enum SCP_SERVER_STATES_E scp_v1s_list_sessions(struct SCP_CONNECTION* c, int sescnt, struct SCP_DISCONNECTED_SESSION* ds, SCP_SID* sid); /* 046 was: 031 struct SCP_DISCONNECTED_SESSION* ds, */ enum SCP_SERVER_STATES_E scp_v1s_reconnect_session(struct SCP_CONNECTION* c, SCP_DISPLAY d); #endif xrdp-0.9.12/sesman/libscp/libscp_session.c000644 001751 001751 00000023237 13544635323 020444 0ustar00metameta000000 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 libscp_session.c * @brief SCP_SESSION handling code * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "libscp_session.h" #include #include #include //extern struct log_config* s_log; /*******************************************************************/ struct SCP_SESSION * scp_session_create(void) { struct SCP_SESSION *s; s = (struct SCP_SESSION *)g_malloc(sizeof(struct SCP_SESSION), 1); if (0 == s) { log_message(LOG_LEVEL_ERROR, "[session:%d] session create: malloc error", __LINE__); return 0; } return s; } /*******************************************************************/ int scp_session_set_type(struct SCP_SESSION *s, tui8 type) { switch (type) { case SCP_SESSION_TYPE_XVNC: s->type = SCP_SESSION_TYPE_XVNC; break; case SCP_SESSION_TYPE_XRDP: s->type = SCP_SESSION_TYPE_XRDP; break; case SCP_SESSION_TYPE_XORG: s->type = SCP_SESSION_TYPE_XORG; break; case SCP_GW_AUTHENTICATION: s->type = SCP_GW_AUTHENTICATION; break; case SCP_SESSION_TYPE_MANAGE: s->type = SCP_SESSION_TYPE_MANAGE; s->mng = (struct SCP_MNG_DATA *)g_malloc(sizeof(struct SCP_MNG_DATA), 1); if (NULL == s->mng) { log_message(LOG_LEVEL_ERROR, "[session:%d] set_type: internal error", __LINE__); return 1; } break; default: log_message(LOG_LEVEL_WARNING, "[session:%d] set_type: unknown type", __LINE__); return 1; } return 0; } /*******************************************************************/ int scp_session_set_version(struct SCP_SESSION *s, tui32 version) { switch (version) { case 0: s->version = 0; break; case 1: s->version = 1; break; default: log_message(LOG_LEVEL_WARNING, "[session:%d] set_version: unknown version", __LINE__); return 1; } return 0; } /*******************************************************************/ int scp_session_set_height(struct SCP_SESSION *s, tui16 h) { s->height = h; return 0; } /*******************************************************************/ int scp_session_set_width(struct SCP_SESSION *s, tui16 w) { s->width = w; return 0; } /*******************************************************************/ int scp_session_set_bpp(struct SCP_SESSION *s, tui8 bpp) { switch (bpp) { case 8: case 15: case 16: case 24: case 32: s->bpp = bpp; break; default: return 1; } return 0; } /*******************************************************************/ int scp_session_set_rsr(struct SCP_SESSION *s, tui8 rsr) { if (s->rsr) { s->rsr = 1; } else { s->rsr = 0; } return 0; } /*******************************************************************/ int scp_session_set_locale(struct SCP_SESSION *s, const char *str) { if (0 == str) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_locale: null locale", __LINE__); s->locale[0] = '\0'; return 1; } g_strncpy(s->locale, str, 17); s->locale[17] = '\0'; return 0; } /*******************************************************************/ int scp_session_set_username(struct SCP_SESSION *s, const char *str) { if (0 == str) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_username: null username", __LINE__); return 1; } if (0 != s->username) { g_free(s->username); } s->username = g_strdup(str); if (0 == s->username) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_username: strdup error", __LINE__); return 1; } return 0; } /*******************************************************************/ int scp_session_set_password(struct SCP_SESSION *s, const char *str) { if (0 == str) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_password: null password", __LINE__); return 1; } if (0 != s->password) { g_free(s->password); } s->password = g_strdup(str); if (0 == s->password) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_password: strdup error", __LINE__); return 1; } return 0; } /*******************************************************************/ int scp_session_set_domain(struct SCP_SESSION *s, const char *str) { if (0 == str) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_domain: null domain", __LINE__); return 1; } if (0 != s->domain) { g_free(s->domain); } s->domain = g_strdup(str); if (0 == s->domain) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_domain: strdup error", __LINE__); return 1; } return 0; } /*******************************************************************/ int scp_session_set_program(struct SCP_SESSION *s, const char *str) { if (0 == str) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_program: null program", __LINE__); return 1; } if (0 != s->program) { g_free(s->program); } s->program = g_strdup(str); if (0 == s->program) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_program: strdup error", __LINE__); return 1; } return 0; } /*******************************************************************/ int scp_session_set_directory(struct SCP_SESSION *s, const char *str) { if (0 == str) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_directory: null directory", __LINE__); return 1; } if (0 != s->directory) { g_free(s->directory); } s->directory = g_strdup(str); if (0 == s->directory) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_directory: strdup error", __LINE__); return 1; } return 0; } /*******************************************************************/ int scp_session_set_client_ip(struct SCP_SESSION *s, const char *str) { if (0 == str) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_client_ip: null ip", __LINE__); return 1; } if (0 != s->client_ip) { g_free(s->client_ip); } s->client_ip = g_strdup(str); if (0 == s->client_ip) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_client_ip: strdup error", __LINE__); return 1; } return 0; } /*******************************************************************/ int scp_session_set_hostname(struct SCP_SESSION *s, const char *str) { if (0 == str) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_hostname: null hostname", __LINE__); return 1; } if (0 != s->hostname) { g_free(s->hostname); } s->hostname = g_strdup(str); if (0 == s->hostname) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_hostname: strdup error", __LINE__); return 1; } return 0; } /*******************************************************************/ int scp_session_set_errstr(struct SCP_SESSION *s, const char *str) { if (0 == str) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_errstr: null string", __LINE__); return 1; } if (0 != s->errstr) { g_free(s->errstr); } s->errstr = g_strdup(str); if (0 == s->errstr) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_errstr: strdup error", __LINE__); return 1; } return 0; } /*******************************************************************/ int scp_session_set_display(struct SCP_SESSION *s, SCP_DISPLAY display) { s->display = display; return 0; } /*******************************************************************/ int scp_session_set_addr(struct SCP_SESSION *s, int type, const void *addr) { switch (type) { case SCP_ADDRESS_TYPE_IPV4: g_memcpy(&(s->ipv4addr), addr, 4); break; #ifdef IN6ADDR_ANY_INIT case SCP_ADDRESS_TYPE_IPV6: g_memcpy(s->ipv6addr, addr, 16); break; #endif default: return 1; } return 0; } /*******************************************************************/ int scp_session_set_guid(struct SCP_SESSION *s, const tui8 *guid) { if (0 == guid) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_guid: null guid", __LINE__); return 1; } g_memcpy(s->guid, guid, 16); return 0; } /*******************************************************************/ void scp_session_destroy(struct SCP_SESSION *s) { g_free(s->username); g_free(s->password); g_free(s->hostname); g_free(s->domain); g_free(s->program); g_free(s->directory); g_free(s->client_ip); g_free(s->errstr); g_free(s->mng); g_free(s); } xrdp-0.9.12/sesman/libscp/libscp_types.h000644 001751 001751 00000006516 13544635323 020133 0ustar00metameta000000 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 libscp_types.h * @brief libscp data types definitions * @author Simone Fedele * */ #ifndef LIBSCP_TYPES_H #define LIBSCP_TYPES_H #include "os_calls.h" #include "parse.h" #include "arch.h" #include "log.h" #define SCP_SID tui32 #define SCP_DISPLAY tui16 #define SCP_RESOURCE_SHARING_REQUEST_YES 0x01 #define SCP_RESOURCE_SHARING_REQUEST_NO 0x00 #define SCP_SESSION_TYPE_XVNC 0x00 #define SCP_SESSION_TYPE_XRDP 0x01 #define SCP_SESSION_TYPE_MANAGE 0x02 #define SCP_SESSION_TYPE_XORG 0x03 /* SCP_GW_AUTHENTICATION can be used when XRDP + sesman act as a gateway * XRDP sends this command to let sesman verify if the user is allowed * to use the gateway */ #define SCP_GW_AUTHENTICATION 0x04 #define SCP_ADDRESS_TYPE_IPV4 0x00 #define SCP_ADDRESS_TYPE_IPV6 0x01 #define SCP_COMMAND_SET_DEFAULT 0x0000 #define SCP_COMMAND_SET_MANAGE 0x0001 #define SCP_COMMAND_SET_RSR 0x0002 #define SCP_SERVER_MAX_LIST_SIZE 100 #include "libscp_types_mng.h" struct SCP_CONNECTION { int in_sck; struct stream* in_s; struct stream* out_s; }; struct SCP_SESSION { tui8 type; tui32 version; tui16 height; tui16 width; tui8 bpp; tui8 rsr; char locale[18]; char* username; char* password; char* hostname; tui8 addr_type; tui32 ipv4addr; tui8 ipv6addr[16]; SCP_DISPLAY display; char* errstr; struct SCP_MNG_DATA* mng; char* domain; char* program; char* directory; char* client_ip; tui8 guid[16]; }; struct SCP_DISCONNECTED_SESSION { tui32 SID; tui8 type; tui8 status; tui16 height; tui16 width; tui8 bpp; tui8 idle_days; tui8 idle_hours; tui8 idle_minutes; tui16 conn_year; tui8 conn_month; tui8 conn_day; tui8 conn_hour; tui8 conn_minute; tui8 addr_type; tui32 ipv4addr; tui8 ipv6addr[16]; }; enum SCP_CLIENT_STATES_E { SCP_CLIENT_STATE_OK, SCP_CLIENT_STATE_NETWORK_ERR, SCP_CLIENT_STATE_VERSION_ERR, SCP_CLIENT_STATE_SEQUENCE_ERR, SCP_CLIENT_STATE_SIZE_ERR, SCP_CLIENT_STATE_INTERNAL_ERR, SCP_CLIENT_STATE_SESSION_LIST, SCP_CLIENT_STATE_LIST_OK, SCP_CLIENT_STATE_RESEND_CREDENTIALS, SCP_CLIENT_STATE_CONNECTION_DENIED, SCP_CLIENT_STATE_PWD_CHANGE_REQ, SCP_CLIENT_STATE_RECONNECT_SINGLE, SCP_CLIENT_STATE_SELECTION_CANCEL, SCP_CLIENT_STATE_END }; enum SCP_SERVER_STATES_E { SCP_SERVER_STATE_OK, SCP_SERVER_STATE_VERSION_ERR, SCP_SERVER_STATE_NETWORK_ERR, SCP_SERVER_STATE_SEQUENCE_ERR, SCP_SERVER_STATE_INTERNAL_ERR, SCP_SERVER_STATE_SESSION_TYPE_ERR, SCP_SERVER_STATE_SIZE_ERR, SCP_SERVER_STATE_SELECTION_CANCEL, /*SCP_SERVER_STATE_FORCE_NEW,*/ SCP_SERVER_STATE_START_MANAGE, SCP_SERVER_STATE_MNG_LISTREQ, SCP_SERVER_STATE_MNG_ACTION, SCP_SERVER_STATE_END }; #endif xrdp-0.9.12/sesman/libscp/libscp_v0.c000644 001751 001751 00000033227 13544635323 017306 0ustar00metameta000000 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 libscp_v0.c * @brief libscp version 0 code * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "libscp_v0.h" #include "os_calls.h" extern struct log_config *s_log; /* client API */ /******************************************************************************/ enum SCP_CLIENT_STATES_E scp_v0c_connect(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { tui32 version; tui32 size; tui16 sz; init_stream(c->in_s, c->in_s->size); init_stream(c->out_s, c->in_s->size); LOG_DBG("[v0:%d] starting connection", __LINE__); g_tcp_set_non_blocking(c->in_sck); g_tcp_set_no_delay(c->in_sck); s_push_layer(c->out_s, channel_hdr, 8); /* code */ if (s->type == SCP_SESSION_TYPE_XVNC) { out_uint16_be(c->out_s, 0); } else if (s->type == SCP_SESSION_TYPE_XRDP) { out_uint16_be(c->out_s, 10); } else if (s->type == SCP_SESSION_TYPE_XORG) { out_uint16_be(c->out_s, 20); } else { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__); return SCP_CLIENT_STATE_INTERNAL_ERR; } sz = g_strlen(s->username); out_uint16_be(c->out_s, sz); out_uint8a(c->out_s, s->username, sz); sz = g_strlen(s->password); out_uint16_be(c->out_s, sz); out_uint8a(c->out_s, s->password, sz); out_uint16_be(c->out_s, s->width); out_uint16_be(c->out_s, s->height); out_uint16_be(c->out_s, s->bpp); s_mark_end(c->out_s); s_pop_layer(c->out_s, channel_hdr); /* version */ out_uint32_be(c->out_s, 0); /* size */ out_uint32_be(c->out_s, c->out_s->end - c->out_s->data); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, c->out_s->end - c->out_s->data)) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__); return SCP_CLIENT_STATE_NETWORK_ERR; } if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__); return SCP_CLIENT_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (0 != version) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: version error", __LINE__); return SCP_CLIENT_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); if (size < 14) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: packet size error", __LINE__); return SCP_CLIENT_STATE_SIZE_ERR; } /* getting payload */ init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8)) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__); return SCP_CLIENT_STATE_NETWORK_ERR; } /* check code */ in_uint16_be(c->in_s, sz); if (3 != sz) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: sequence error", __LINE__); return SCP_CLIENT_STATE_SEQUENCE_ERR; } /* message payload */ in_uint16_be(c->in_s, sz); if (1 != sz) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: connection denied", __LINE__); return SCP_CLIENT_STATE_CONNECTION_DENIED; } in_uint16_be(c->in_s, sz); s->display = sz; LOG_DBG("[v0:%d] connection terminated", __LINE__); return SCP_CLIENT_STATE_END; } /* server API */ /******************************************************************************/ enum SCP_SERVER_STATES_E scp_v0s_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s, int skipVchk) { tui32 version = 0; tui32 size; struct SCP_SESSION *session = 0; tui16 sz; tui32 code = 0; char *buf = 0; if (!skipVchk) { LOG_DBG("[v0:%d] starting connection", __LINE__); if (0 == scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { c->in_s->end = c->in_s->data + 8; in_uint32_be(c->in_s, version); if (version != 0) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: version error", __LINE__); return SCP_SERVER_STATE_VERSION_ERR; } } else { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } } in_uint32_be(c->in_s, size); init_stream(c->in_s, 8196); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8)) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } c->in_s->end = c->in_s->data + (size - 8); in_uint16_be(c->in_s, code); if (code == 0 || code == 10 || code == 20) { session = scp_session_create(); if (0 == session) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_INTERNAL_ERR; } scp_session_set_version(session, version); if (code == 0) { scp_session_set_type(session, SCP_SESSION_TYPE_XVNC); } else if (code == 10) { scp_session_set_type(session, SCP_SESSION_TYPE_XRDP); } else if (code == 20) { scp_session_set_type(session, SCP_SESSION_TYPE_XORG); } /* reading username */ in_uint16_be(c->in_s, sz); buf = g_new0(char, sz + 1); in_uint8a(c->in_s, buf, sz); buf[sz] = '\0'; if (0 != scp_session_set_username(session, buf)) { scp_session_destroy(session); log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: error setting username", __LINE__); g_free(buf); return SCP_SERVER_STATE_INTERNAL_ERR; } g_free(buf); /* reading password */ in_uint16_be(c->in_s, sz); buf = g_new0(char, sz + 1); in_uint8a(c->in_s, buf, sz); buf[sz] = '\0'; if (0 != scp_session_set_password(session, buf)) { scp_session_destroy(session); log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: error setting password", __LINE__); g_free(buf); return SCP_SERVER_STATE_INTERNAL_ERR; } g_free(buf); /* width */ in_uint16_be(c->in_s, sz); scp_session_set_width(session, sz); /* height */ in_uint16_be(c->in_s, sz); scp_session_set_height(session, sz); /* bpp */ in_uint16_be(c->in_s, sz); if (0 != scp_session_set_bpp(session, (tui8)sz)) { scp_session_destroy(session); log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: unsupported bpp: %d", __LINE__, (tui8)sz); return SCP_SERVER_STATE_INTERNAL_ERR; } if (s_check_rem(c->in_s, 2)) { /* reading domain */ in_uint16_be(c->in_s, sz); if (sz > 0) { buf = g_new0(char, sz + 1); in_uint8a(c->in_s, buf, sz); buf[sz] = '\0'; scp_session_set_domain(session, buf); g_free(buf); } } if (s_check_rem(c->in_s, 2)) { /* reading program */ in_uint16_be(c->in_s, sz); if (sz > 0) { buf = g_new0(char, sz + 1); in_uint8a(c->in_s, buf, sz); buf[sz] = '\0'; scp_session_set_program(session, buf); g_free(buf); } } if (s_check_rem(c->in_s, 2)) { /* reading directory */ in_uint16_be(c->in_s, sz); if (sz > 0) { buf = g_new0(char, sz + 1); in_uint8a(c->in_s, buf, sz); buf[sz] = '\0'; scp_session_set_directory(session, buf); g_free(buf); } } if (s_check_rem(c->in_s, 2)) { /* reading client IP address */ in_uint16_be(c->in_s, sz); if (sz > 0) { buf = g_new0(char, sz + 1); in_uint8a(c->in_s, buf, sz); buf[sz] = '\0'; scp_session_set_client_ip(session, buf); g_free(buf); } } } else if (code == SCP_GW_AUTHENTICATION) { /* g_writeln("Command is SCP_GW_AUTHENTICATION"); */ session = scp_session_create(); if (0 == session) { /* until syslog merge log_message(s_log, LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__);*/ return SCP_SERVER_STATE_INTERNAL_ERR; } scp_session_set_version(session, version); scp_session_set_type(session, SCP_GW_AUTHENTICATION); /* reading username */ in_uint16_be(c->in_s, sz); buf = g_new0(char, sz + 1); in_uint8a(c->in_s, buf, sz); buf[sz] = '\0'; /* g_writeln("Received user name: %s",buf); */ if (0 != scp_session_set_username(session, buf)) { scp_session_destroy(session); /* until syslog merge log_message(s_log, LOG_LEVEL_WARNING, "[v0:%d] connection aborted: error setting username", __LINE__);*/ g_free(buf); return SCP_SERVER_STATE_INTERNAL_ERR; } g_free(buf); /* reading password */ in_uint16_be(c->in_s, sz); buf = g_new0(char, sz + 1); in_uint8a(c->in_s, buf, sz); buf[sz] = '\0'; /* g_writeln("Received password: %s",buf); */ if (0 != scp_session_set_password(session, buf)) { scp_session_destroy(session); /* until syslog merge log_message(s_log, LOG_LEVEL_WARNING, "[v0:%d] connection aborted: error setting password", __LINE__); */ g_free(buf); return SCP_SERVER_STATE_INTERNAL_ERR; } g_free(buf); } else { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } (*s) = session; return SCP_SERVER_STATE_OK; } /******************************************************************************/ enum SCP_SERVER_STATES_E scp_v0s_allow_connection(struct SCP_CONNECTION *c, SCP_DISPLAY d, const tui8 *guid) { int msg_size; msg_size = guid == 0 ? 14 : 14 + 16; out_uint32_be(c->out_s, 0); /* version */ out_uint32_be(c->out_s, msg_size); /* size */ out_uint16_be(c->out_s, 3); /* cmd */ out_uint16_be(c->out_s, 1); /* data */ out_uint16_be(c->out_s, d); /* data */ if (msg_size > 14) { out_uint8a(c->out_s, guid, 16); } s_mark_end(c->out_s); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, c->out_s->end - c->out_s->data)) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } LOG_DBG("[v0:%d] connection terminated (allowed)", __LINE__); return SCP_SERVER_STATE_OK; } /******************************************************************************/ enum SCP_SERVER_STATES_E scp_v0s_deny_connection(struct SCP_CONNECTION *c) { out_uint32_be(c->out_s, 0); /* version */ out_uint32_be(c->out_s, 14); /* size */ out_uint16_be(c->out_s, 3); /* cmd */ out_uint16_be(c->out_s, 0); /* data = 0 - means NOT ok*/ out_uint16_be(c->out_s, 0); /* reserved for display number*/ s_mark_end(c->out_s); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, c->out_s->end - c->out_s->data)) { log_message(LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } LOG_DBG("[v0:%d] connection terminated (denied)", __LINE__); return SCP_SERVER_STATE_OK; } /******************************************************************************/ enum SCP_SERVER_STATES_E scp_v0s_replyauthentication(struct SCP_CONNECTION *c, unsigned short int value) { out_uint32_be(c->out_s, 0); /* version */ out_uint32_be(c->out_s, 14); /* size */ /* cmd SCP_GW_AUTHENTICATION means authentication reply */ out_uint16_be(c->out_s, SCP_GW_AUTHENTICATION); out_uint16_be(c->out_s, value); /* reply code */ out_uint16_be(c->out_s, 0); /* dummy data */ s_mark_end(c->out_s); /* g_writeln("Total number of bytes that will be sent %d",c->out_s->end - c->out_s->data);*/ if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, c->out_s->end - c->out_s->data)) { /* until syslog merge log_message(s_log, LOG_LEVEL_WARNING, "[v0:%d] connection aborted: network error", __LINE__); */ return SCP_SERVER_STATE_NETWORK_ERR; } /* until syslog merge LOG_DBG(s_log, "[v0:%d] connection terminated (scp_v0s_deny_authentication)", __LINE__);*/ return SCP_SERVER_STATE_OK; } xrdp-0.9.12/sesman/libscp/libscp_v1s_mng.h000644 001751 001751 00000003753 13544635323 020341 0ustar00metameta000000 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 libscp_v1s_mng.h * @brief libscp version 1 server api declarations - session management * @author Simone Fedele * */ #ifndef LIBSCP_V1S_MNG_H #define LIBSCP_V1S_MNG_H #include "libscp.h" /* server API */ /** * * @brief processes the stream using scp version 1 * @param c connection descriptor * @param s pointer to session descriptor pointer * * this function places in *s the address of a newly allocated SCP_SESSION structure * that should be free()d */ enum SCP_SERVER_STATES_E scp_v1s_mng_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s); /** * * @brief allows connection to sesman * @param c connection descriptor * */ /* 002 */ enum SCP_SERVER_STATES_E scp_v1s_mng_allow_connection(struct SCP_CONNECTION* c, struct SCP_SESSION* s); /** * * @brief denies connection to sesman * @param c connection descriptor * @param reason pointer to a string containing the reason for denying connection * */ /* 003 */ enum SCP_SERVER_STATES_E scp_v1s_mng_deny_connection(struct SCP_CONNECTION* c, const char *reason); /** * * @brief sends session list * @param c connection descriptor * */ /* 006 */ enum SCP_SERVER_STATES_E scp_v1s_mng_list_sessions(struct SCP_CONNECTION* c, struct SCP_SESSION* s, int sescnt, struct SCP_DISCONNECTED_SESSION* ds); // SCP_SID* sid); #endif xrdp-0.9.12/sesman/libscp/libscp_tcp.h000644 001751 001751 00000003031 13544635323 017542 0ustar00metameta000000 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 libscp_tcp.h * @brief Tcp stream functions declarations * @author Jay Sorg, Simone Fedele * */ #ifndef LIBSCP_TCP_H #define LIBSCP_TCP_H #include "libscp.h" /** * * @brief Force receiving data from tcp stream * @param sck The socket to read from * @param data Data buffer * @param len Data buffer size * @return 0 on success, 1 on error * */ int scp_tcp_force_recv(int sck, char* data, int len); /** * * @brief Force sending data to tcp stream * @param sck the socket to write to * @param data Data buffer * @param len Data buffer size * @return 0 on success, 1 on error * */ int scp_tcp_force_send(int sck, char* data, int len); /** * * @brief Binds the listening socket * @param sck Listening socket * @param addr Listening address * @param port Listening port * @return 0 on success, -1 on error * */ int scp_tcp_bind(int sck, char* addr, char* port); #endif xrdp-0.9.12/sesman/libscp/libscp_connection.h000644 001751 001751 00000002300 13544635323 021111 0ustar00metameta000000 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 libscp_connection.h * @brief SCP_CONNECTION handling code * @author Simone Fedele * */ #ifndef LIBSCP_CONNECTION_H #define LIBSCP_CONNECTION_H #include "libscp.h" /** * * @brief creates a new connection * @param sck the connection socket * * @return a struct SCP_CONNECTION* object on success, NULL otherwise * */ struct SCP_CONNECTION* scp_connection_create(int sck); /** * * @brief destroys a struct SCP_CONNECTION* object * @param c the object to be destroyed * */ void scp_connection_destroy(struct SCP_CONNECTION* c); #endif xrdp-0.9.12/sesman/libscp/libscp_v1c.h000644 001751 001751 00000003164 13544635323 017454 0ustar00metameta000000 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 libscp_v1c.h * @brief libscp version 1 client api declarations * @author Simone Fedele * */ #ifndef LIBSCP_V1C_H #define LIBSCP_V1C_H #include "libscp.h" /* client API */ /* 001 */ enum SCP_CLIENT_STATES_E scp_v1c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s); /* 004 */ enum SCP_CLIENT_STATES_E scp_v1c_resend_credentials(struct SCP_CONNECTION* c, struct SCP_SESSION* s); /* 021 */ enum SCP_CLIENT_STATES_E scp_v1c_pwd_change(struct SCP_CONNECTION* c, char* newpass); /* 022 */ enum SCP_CLIENT_STATES_E scp_v1c_pwd_change_cancel(struct SCP_CONNECTION* c); /* 041 */ enum SCP_CLIENT_STATES_E scp_v1c_get_session_list(struct SCP_CONNECTION* c, int* scount, struct SCP_DISCONNECTED_SESSION** s); /* 043 */ enum SCP_CLIENT_STATES_E scp_v1c_select_session(struct SCP_CONNECTION* c, struct SCP_SESSION* s, SCP_SID sid); /* 044 */ enum SCP_CLIENT_STATES_E scp_v1c_select_session_cancel(struct SCP_CONNECTION* c); #endif xrdp-0.9.12/sesman/libscp/Makefile.in000644 001751 001751 00000057533 13601646126 017331 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG subdir = sesman/libscp 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libscp_la_DEPENDENCIES = $(top_builddir)/common/libcommon.la am_libscp_la_OBJECTS = libscp_connection.lo libscp_init.lo \ libscp_lock.lo libscp_session.lo libscp_tcp.lo libscp_v0.lo \ libscp_v1c.lo libscp_v1c_mng.lo libscp_v1s.lo \ libscp_v1s_mng.lo libscp_vX.lo libscp_la_OBJECTS = $(am_libscp_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)/libscp_connection.Plo \ ./$(DEPDIR)/libscp_init.Plo ./$(DEPDIR)/libscp_lock.Plo \ ./$(DEPDIR)/libscp_session.Plo ./$(DEPDIR)/libscp_tcp.Plo \ ./$(DEPDIR)/libscp_v0.Plo ./$(DEPDIR)/libscp_v1c.Plo \ ./$(DEPDIR)/libscp_v1c_mng.Plo ./$(DEPDIR)/libscp_v1s.Plo \ ./$(DEPDIR)/libscp_v1s_mng.Plo ./$(DEPDIR)/libscp_vX.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 = $(libscp_la_SOURCES) DIST_SOURCES = $(libscp_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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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__append_1) module_LTLIBRARIES = \ libscp.la libscp_la_SOURCES = \ libscp.h \ libscp_commands.h \ libscp_commands_mng.h \ libscp_connection.c \ libscp_connection.h \ libscp_init.c \ libscp_init.h \ libscp_lock.c \ libscp_lock.h \ libscp_session.c \ libscp_session.h \ libscp_tcp.c \ libscp_tcp.h \ libscp_types.h \ libscp_types_mng.h \ libscp_v0.c \ libscp_v0.h \ libscp_v1c.c \ libscp_v1c.h \ libscp_v1c_mng.c \ libscp_v1c_mng.h \ libscp_v1s.c \ libscp_v1s.h \ libscp_v1s_mng.c \ libscp_v1s_mng.h \ libscp_vX.c \ libscp_vX.h libscp_la_LIBADD = \ $(top_builddir)/common/libcommon.la \ -lpthread 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/libscp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign sesman/libscp/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: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libscp.la: $(libscp_la_OBJECTS) $(libscp_la_DEPENDENCIES) $(EXTRA_libscp_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) -rpath $(moduledir) $(libscp_la_OBJECTS) $(libscp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_connection.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_init.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_lock.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_session.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_tcp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_v0.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_v1c.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_v1c_mng.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_v1s.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_v1s_mng.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscp_vX.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libscp_connection.Plo -rm -f ./$(DEPDIR)/libscp_init.Plo -rm -f ./$(DEPDIR)/libscp_lock.Plo -rm -f ./$(DEPDIR)/libscp_session.Plo -rm -f ./$(DEPDIR)/libscp_tcp.Plo -rm -f ./$(DEPDIR)/libscp_v0.Plo -rm -f ./$(DEPDIR)/libscp_v1c.Plo -rm -f ./$(DEPDIR)/libscp_v1c_mng.Plo -rm -f ./$(DEPDIR)/libscp_v1s.Plo -rm -f ./$(DEPDIR)/libscp_v1s_mng.Plo -rm -f ./$(DEPDIR)/libscp_vX.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)/libscp_connection.Plo -rm -f ./$(DEPDIR)/libscp_init.Plo -rm -f ./$(DEPDIR)/libscp_lock.Plo -rm -f ./$(DEPDIR)/libscp_session.Plo -rm -f ./$(DEPDIR)/libscp_tcp.Plo -rm -f ./$(DEPDIR)/libscp_v0.Plo -rm -f ./$(DEPDIR)/libscp_v1c.Plo -rm -f ./$(DEPDIR)/libscp_v1c_mng.Plo -rm -f ./$(DEPDIR)/libscp_v1s.Plo -rm -f ./$(DEPDIR)/libscp_v1s_mng.Plo -rm -f ./$(DEPDIR)/libscp_vX.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: xrdp-0.9.12/sesman/libscp/libscp_commands.h000644 001751 001751 00000001633 13544635323 020563 0ustar00metameta000000 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 libscp_commands.h * @brief libscp data types definitions * @author Simone Fedele * */ #ifndef LIBSCP_COMMANDS_H #define LIBSCP_COMMANDS_H #include "libscp_commands_mng.h" #define SCP_CMD_LOGIN 0x0001 #define SCP_CMD_CONN_ERROR 0xFFFF #endif xrdp-0.9.12/sesman/libscp/libscp_lock.c000644 001751 001751 00000010360 13544635323 017702 0ustar00metameta000000 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. * * session manager * linux only */ #if defined(HAVE_CONFIG_H) #include #endif #include "libscp_lock.h" #include "thread_calls.h" #include pthread_mutex_t lock_fork; /* this lock protects the counters */ pthread_mutexattr_t lock_fork_attr; /* mutex attributes */ tbus lock_fork_req; /* semaphore on which the process that are going to fork suspend on */ tbus lock_fork_wait; /* semaphore on which the suspended process wait on */ int lock_fork_forkers_count; /* threads that want to fork */ int lock_fork_blockers_count; /* threads that are blocking fork */ int lock_fork_waiting_count; /* threads suspended until the fork finishes */ void scp_lock_init(void) { /* initializing fork lock */ pthread_mutexattr_init(&lock_fork_attr); pthread_mutex_init(&lock_fork, &lock_fork_attr); lock_fork_req = tc_sem_create(0); lock_fork_wait = tc_sem_create(0); /* here we don't use locking because lock_init() should be called BEFORE */ /* any thread is created */ lock_fork_blockers_count = 0; lock_fork_waiting_count = 0; lock_fork_forkers_count = 0; } /******************************************************************************/ void scp_lock_fork_request(void) { /* lock mutex */ pthread_mutex_lock(&lock_fork); if (lock_fork_blockers_count == 0) { /* if no one is blocking fork(), then we're allowed to fork */ tc_sem_inc(lock_fork_req); } lock_fork_forkers_count++; pthread_mutex_unlock(&lock_fork); /* we wait to be allowed to fork() */ tc_sem_dec(lock_fork_req); } /******************************************************************************/ void scp_lock_fork_release(void) { pthread_mutex_lock(&lock_fork); lock_fork_forkers_count--; /* if there's someone else that want to fork, we let him fork() */ if (lock_fork_forkers_count > 0) { tc_sem_inc(lock_fork_req); } for (; lock_fork_waiting_count > 0; lock_fork_waiting_count--) { /* waking up the other processes */ tc_sem_inc(lock_fork_wait); } pthread_mutex_unlock(&lock_fork); } /******************************************************************************/ void scp_lock_fork_critical_section_end(int blocking) { //LOG_DBG("lock_fork_critical_section_end()",0); /* lock mutex */ pthread_mutex_lock(&lock_fork); if (blocking == LIBSCP_LOCK_FORK_BLOCKER) { lock_fork_blockers_count--; } /* if there's someone who wants to fork and we're the last blocking */ /* then we let him go */ if ((lock_fork_blockers_count == 0) && (lock_fork_forkers_count > 0)) { tc_sem_inc(lock_fork_req); } pthread_mutex_unlock(&lock_fork); } /******************************************************************************/ int scp_lock_fork_critical_section_start(void) { //LOG_DBG("lock_fork_critical_section_start()",0); do { pthread_mutex_lock(&lock_fork); /* someone requested to fork */ if (lock_fork_forkers_count > 0) { lock_fork_waiting_count++; pthread_mutex_unlock(&lock_fork); /* we wait until the fork finishes */ tc_sem_dec(lock_fork_wait); } else { /* no fork, so we can go on... */ lock_fork_blockers_count++; pthread_mutex_unlock(&lock_fork); return LIBSCP_LOCK_FORK_BLOCKER; } } while (1); /* we'll never get here */ return LIBSCP_LOCK_FORK_WAITING; } xrdp-0.9.12/sesman/libscp/libscp_tcp.c000644 001751 001751 00000005410 13544635323 017540 0ustar00metameta000000 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 tcp.c * @brief Tcp stream functions * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "libscp_tcp.h" extern struct log_config *s_log; /*****************************************************************************/ int scp_tcp_force_recv(int sck, char *data, int len) { int rcvd; int block; LOG_DBG("scp_tcp_force_recv()"); block = scp_lock_fork_critical_section_start(); while (len > 0) { rcvd = g_tcp_recv(sck, data, len, 0); if (rcvd == -1) { if (g_tcp_last_error_would_block(sck)) { g_sleep(1); } else { scp_lock_fork_critical_section_end(block); return 1; } } else if (rcvd == 0) { scp_lock_fork_critical_section_end(block); return 1; } else { data += rcvd; len -= rcvd; } } scp_lock_fork_critical_section_end(block); return 0; } /*****************************************************************************/ int scp_tcp_force_send(int sck, char *data, int len) { int sent; int block; LOG_DBG("scp_tcp_force_send()"); block = scp_lock_fork_critical_section_start(); while (len > 0) { sent = g_tcp_send(sck, data, len, 0); if (sent == -1) { if (g_tcp_last_error_would_block(sck)) { g_sleep(1); } else { scp_lock_fork_critical_section_end(block); return 1; } } else if (sent == 0) { scp_lock_fork_critical_section_end(block); return 1; } else { data += sent; len -= sent; } } scp_lock_fork_critical_section_end(block); return 0; } /*****************************************************************************/ int scp_tcp_bind(int sck, char *addr, char *port) { return g_tcp_bind_address(sck, port, addr); } xrdp-0.9.12/sesman/libscp/libscp_session.h000644 001751 001751 00000004531 13544635323 020445 0ustar00metameta000000 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 libscp_session.h * @brief SCP_SESSION handling code * @author Simone Fedele * */ #ifndef LIBSCP_SESSION_H #define LIBSCP_SESSION_H #include "libscp.h" /** * * @brief creates a new connection * @param sck the connection socket * * @return a struct SCP_SESSION* object on success, NULL otherwise * */ struct SCP_SESSION* scp_session_create(void); int scp_session_set_type(struct SCP_SESSION* s, tui8 type); int scp_session_set_version(struct SCP_SESSION* s, tui32 version); int scp_session_set_height(struct SCP_SESSION* s, tui16 h); int scp_session_set_width(struct SCP_SESSION* s, tui16 w); int scp_session_set_bpp(struct SCP_SESSION* s, tui8 bpp); int scp_session_set_rsr(struct SCP_SESSION* s, tui8 rsr); int scp_session_set_locale(struct SCP_SESSION* s, const char *str); int scp_session_set_username(struct SCP_SESSION* s, const char *str); int scp_session_set_password(struct SCP_SESSION* s, const char *str); int scp_session_set_domain(struct SCP_SESSION* s, const char *str); int scp_session_set_program(struct SCP_SESSION* s, const char *str); int scp_session_set_directory(struct SCP_SESSION* s, const char *str); int scp_session_set_client_ip(struct SCP_SESSION* s, const char *str); int scp_session_set_hostname(struct SCP_SESSION* s, const char *str); int scp_session_set_addr(struct SCP_SESSION* s, int type, const void* addr); int scp_session_set_display(struct SCP_SESSION* s, SCP_DISPLAY display); int scp_session_set_errstr(struct SCP_SESSION* s, const char *str); int scp_session_set_guid(struct SCP_SESSION *s, const tui8 *guid); /** * * @brief destroys a session object * @param s the object to be destroyed * */ void scp_session_destroy(struct SCP_SESSION* s); #endif xrdp-0.9.12/sesman/libscp/libscp_v0.h000644 001751 001751 00000004034 13544635323 017305 0ustar00metameta000000 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 libscp_v0.h * @brief libscp version 0 declarations * @author Simone Fedele * */ #ifndef LIBSCP_V0_H #define LIBSCP_V0_H #include "libscp.h" /* client API */ /** * * @brief connects to sesman using scp v0 * @param c connection descriptor * @param s session descriptor * @param d display * */ enum SCP_CLIENT_STATES_E scp_v0c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s); /* server API */ /** * * @brief processes the stream using scp version 0 * @param c connection descriptor * @param s session descriptor * @param skipVchk if set to !0 skips the version control (to be used after * scp_vXs_accept() ) * */ enum SCP_SERVER_STATES_E scp_v0s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk); /** * * @brief allows the connection to TS, returning the display port * @param c connection descriptor * */ enum SCP_SERVER_STATES_E scp_v0s_allow_connection(struct SCP_CONNECTION* c, SCP_DISPLAY d, const tui8 *guid); /** * * @brief denies the connection to TS * @param c connection descriptor * */ enum SCP_SERVER_STATES_E scp_v0s_deny_connection(struct SCP_CONNECTION* c); /** * @brief send reply to an authentication request * @param c connection descriptor * @param value the reply code 0 means ok * @return */ enum SCP_SERVER_STATES_E scp_v0s_replyauthentication(struct SCP_CONNECTION* c, unsigned short int value); #endif xrdp-0.9.12/sesman/libscp/libscp_v1s_mng.c000644 001751 001751 00000023264 13544635323 020333 0ustar00metameta000000 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 libscp_v1s_mng.c * @brief libscp version 1 server api code - session management * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #ifndef LIBSCP_V1S_MNG_C #define LIBSCP_V1S_MNG_C #include "libscp_v1s_mng.h" //extern struct log_config* s_log; static enum SCP_SERVER_STATES_E _scp_v1s_mng_check_response(struct SCP_CONNECTION *c, struct SCP_SESSION *s); /* server API */ enum SCP_SERVER_STATES_E scp_v1s_mng_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s) { struct SCP_SESSION *session; tui32 ipaddr; tui16 cmd; tui8 sz; char buf[257]; /* reading command */ in_uint16_be(c->in_s, cmd); if (cmd != 1) /* manager login */ { return SCP_SERVER_STATE_SEQUENCE_ERR; } session = scp_session_create(); if (0 == session) { return SCP_SERVER_STATE_INTERNAL_ERR; } scp_session_set_version(session, 1); scp_session_set_type(session, SCP_SESSION_TYPE_MANAGE); /* reading username */ in_uint8(c->in_s, sz); buf[sz] = '\0'; in_uint8a(c->in_s, buf, sz); if (0 != scp_session_set_username(session, buf)) { scp_session_destroy(session); return SCP_SERVER_STATE_INTERNAL_ERR; } /* reading password */ in_uint8(c->in_s, sz); buf[sz] = '\0'; in_uint8a(c->in_s, buf, sz); if (0 != scp_session_set_password(session, buf)) { scp_session_destroy(session); return SCP_SERVER_STATE_INTERNAL_ERR; } /* reading remote address */ in_uint8(c->in_s, sz); if (sz == SCP_ADDRESS_TYPE_IPV4) { in_uint32_be(c->in_s, ipaddr); scp_session_set_addr(session, sz, &ipaddr); } else if (sz == SCP_ADDRESS_TYPE_IPV6) { in_uint8a(c->in_s, buf, 16); scp_session_set_addr(session, sz, buf); } /* reading hostname */ in_uint8(c->in_s, sz); buf[sz] = '\0'; in_uint8a(c->in_s, buf, sz); if (0 != scp_session_set_hostname(session, buf)) { scp_session_destroy(session); return SCP_SERVER_STATE_INTERNAL_ERR; } /* returning the struct */ (*s) = session; return SCP_SERVER_STATE_START_MANAGE; } /* 002 */ enum SCP_SERVER_STATES_E scp_v1s_mng_allow_connection(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { init_stream(c->out_s, c->out_s->size); out_uint32_be(c->out_s, 1); /* packet size: 4 + 4 + 2 + 2 */ /* version + size + cmdset + cmd */ out_uint32_be(c->out_s, 12); out_uint16_be(c->out_s, SCP_COMMAND_SET_MANAGE); out_uint16_be(c->out_s, SCP_CMD_MNG_LOGIN_ALLOW); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, 12)) { return SCP_SERVER_STATE_NETWORK_ERR; } return _scp_v1s_mng_check_response(c, s); } /* 003 */ enum SCP_SERVER_STATES_E scp_v1s_mng_deny_connection(struct SCP_CONNECTION *c, const char *reason) { int rlen; init_stream(c->out_s, c->out_s->size); /* forcing message not to exceed 64k */ rlen = g_strlen(reason); if (rlen > 65535) { rlen = 65535; } out_uint32_be(c->out_s, 1); /* packet size: 4 + 4 + 2 + 2 + 2 + strlen(reason)*/ /* version + size + cmdset + cmd + msglen + msg */ out_uint32_be(c->out_s, rlen + 14); out_uint16_be(c->out_s, SCP_COMMAND_SET_MANAGE); out_uint16_be(c->out_s, SCP_CMD_MNG_LOGIN_DENY); out_uint16_be(c->out_s, rlen); out_uint8p(c->out_s, reason, rlen); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, rlen + 14)) { return SCP_SERVER_STATE_NETWORK_ERR; } return SCP_SERVER_STATE_END; } /* 006 */ enum SCP_SERVER_STATES_E scp_v1s_mng_list_sessions(struct SCP_CONNECTION *c, struct SCP_SESSION *s, int sescnt, struct SCP_DISCONNECTED_SESSION *ds) { tui32 version = 1; tui32 size = 12; tui16 cmd = SCP_CMD_MNG_LIST; int pktcnt; int idx; int sidx; int pidx; struct SCP_DISCONNECTED_SESSION *cds; /* calculating the number of packets to send */ if (sescnt == 0) { pktcnt = 1; } else { pktcnt = sescnt / SCP_SERVER_MAX_LIST_SIZE; if ((sescnt % SCP_SERVER_MAX_LIST_SIZE) != 0) { pktcnt++; } } for (idx = 0; idx < pktcnt; idx++) { /* ok, we send session session list */ init_stream(c->out_s, c->out_s->size); /* size: ver+size+cmdset+cmd+sescnt+continue+count */ size = 4 + 4 + 2 + 2 + 4 + 1 + 1; /* header */ s_push_layer(c->out_s, channel_hdr, 8); out_uint16_be(c->out_s, SCP_COMMAND_SET_MANAGE); out_uint16_be(c->out_s, cmd); /* session count */ out_uint32_be(c->out_s, sescnt); /* setting the continue flag */ if ((idx + 1)*SCP_SERVER_MAX_LIST_SIZE >= sescnt) { out_uint8(c->out_s, 0); /* setting session count for this packet */ pidx = sescnt - (idx * SCP_SERVER_MAX_LIST_SIZE); out_uint8(c->out_s, pidx); } else { out_uint8(c->out_s, 1); /* setting session count for this packet */ pidx = SCP_SERVER_MAX_LIST_SIZE; out_uint8(c->out_s, pidx); } /* adding session descriptors */ for (sidx = 0; sidx < pidx; sidx++) { /* shortcut to the current session to send */ cds = ds + ((idx) * SCP_SERVER_MAX_LIST_SIZE) + sidx; /* session data */ out_uint32_be(c->out_s, cds->SID); /* session id */ out_uint8(c->out_s, cds->type); out_uint16_be(c->out_s, cds->height); out_uint16_be(c->out_s, cds->width); out_uint8(c->out_s, cds->bpp); out_uint8(c->out_s, cds->idle_days); out_uint8(c->out_s, cds->idle_hours); out_uint8(c->out_s, cds->idle_minutes); size += 13; out_uint16_be(c->out_s, cds->conn_year); out_uint8(c->out_s, cds->conn_month); out_uint8(c->out_s, cds->conn_day); out_uint8(c->out_s, cds->conn_hour); out_uint8(c->out_s, cds->conn_minute); out_uint8(c->out_s, cds->addr_type); size += 7; if (cds->addr_type == SCP_ADDRESS_TYPE_IPV4) { in_uint32_be(c->out_s, cds->ipv4addr); size += 4; } else if (cds->addr_type == SCP_ADDRESS_TYPE_IPV6) { in_uint8a(c->out_s, cds->ipv6addr, 16); size += 16; } } s_pop_layer(c->out_s, channel_hdr); out_uint32_be(c->out_s, version); out_uint32_be(c->out_s, size); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { log_message(LOG_LEVEL_WARNING, "[v1s_mng:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } } return _scp_v1s_mng_check_response(c, s); } static enum SCP_SERVER_STATES_E _scp_v1s_mng_check_response(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { tui32 version; tui32 size; tui16 cmd; // tui8 dim; // char buf[257]; init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { log_message(LOG_LEVEL_WARNING, "[v1s_mng:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version != 1) { log_message(LOG_LEVEL_WARNING, "[v1s_mng:%d] connection aborted: version error", __LINE__); return SCP_SERVER_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); init_stream(c->in_s, c->in_s->size); /* read the rest of the packet */ if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8)) { log_message(LOG_LEVEL_WARNING, "[v1s_mng:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != SCP_COMMAND_SET_MANAGE) { log_message(LOG_LEVEL_WARNING, "[v1s_mng:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } in_uint16_be(c->in_s, cmd); if (cmd == SCP_CMD_MNG_LIST_REQ) /* request session list */ { log_message(LOG_LEVEL_INFO, "[v1s_mng:%d] request session list", __LINE__); return SCP_SERVER_STATE_MNG_LISTREQ; } else if (cmd == SCP_CMD_MNG_ACTION) /* execute an action */ { /*in_uint8(c->in_s, dim); buf[dim]='\0'; in_uint8a(c->in_s, buf, dim); scp_session_set_errstr(s, buf);*/ log_message(LOG_LEVEL_INFO, "[v1s_mng:%d] action request", __LINE__); return SCP_SERVER_STATE_MNG_ACTION; } /* else if (cmd == 20) / * password change * / { in_uint16_be(c->in_s, s->display); return SCP_SERVER_STATE_OK; } else if (cmd == 40) / * session list * / { return SCP_SERVER_STATE_SESSION_LIST; }*/ log_message(LOG_LEVEL_WARNING, "[v1s_mng:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } #endif xrdp-0.9.12/sesman/libscp/libscp_v1s.c000644 001751 001751 00000050210 13544635323 017461 0ustar00metameta000000 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 libscp_v1s.c * @brief libscp version 1 server api code * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #ifndef LIBSCP_V1S_C #define LIBSCP_V1S_C #include "libscp_v1s.h" //extern struct log_config* s_log; /* server API */ enum SCP_SERVER_STATES_E scp_v1s_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s, int skipVchk) { struct SCP_SESSION *session; tui32 version; tui32 size; tui16 cmdset; tui16 cmd; tui8 sz; char buf[257]; if (!skipVchk) { if (0 == scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { in_uint32_be(c->in_s, version); if (version != 1) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: version error", __LINE__); return SCP_SERVER_STATE_VERSION_ERR; } } else { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } } in_uint32_be(c->in_s, size); if (size < 12) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: size error", __LINE__); return SCP_SERVER_STATE_SIZE_ERR; } init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, (size - 8))) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } /* reading command set */ in_uint16_be(c->in_s, cmdset); /* if we are starting a management session */ if (cmdset == SCP_COMMAND_SET_MANAGE) { log_message(LOG_LEVEL_DEBUG, "[v1s:%d] requested management connection", __LINE__); /* should return SCP_SERVER_STATE_START_MANAGE */ return scp_v1s_mng_accept(c, s); } /* if we started with resource sharing... */ if (cmdset == SCP_COMMAND_SET_RSR) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } /* reading command */ in_uint16_be(c->in_s, cmd); if (cmd != 1) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } session = scp_session_create(); if (0 == session) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error (malloc returned NULL)", __LINE__); return SCP_SERVER_STATE_INTERNAL_ERR; } scp_session_set_version(session, 1); in_uint8(c->in_s, sz); if ((sz != SCP_SESSION_TYPE_XVNC) && (sz != SCP_SESSION_TYPE_XRDP)) { scp_session_destroy(session); log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: unknown session type", __LINE__); return SCP_SERVER_STATE_SESSION_TYPE_ERR; } scp_session_set_type(session, sz); in_uint16_be(c->in_s, cmd); scp_session_set_height(session, cmd); in_uint16_be(c->in_s, cmd); scp_session_set_width(session, cmd); in_uint8(c->in_s, sz); if (0 != scp_session_set_bpp(session, sz)) { scp_session_destroy(session); log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: unsupported bpp: %d", __LINE__, sz); return SCP_SERVER_STATE_INTERNAL_ERR; } in_uint8(c->in_s, sz); scp_session_set_rsr(session, sz); in_uint8a(c->in_s, buf, 17); buf[17] = '\0'; scp_session_set_locale(session, buf); in_uint8(c->in_s, sz); if (sz == SCP_ADDRESS_TYPE_IPV4) { in_uint32_be(c->in_s, size); scp_session_set_addr(session, sz, &size); } else if (sz == SCP_ADDRESS_TYPE_IPV6) { in_uint8a(c->in_s, buf, 16); scp_session_set_addr(session, sz, buf); } buf[256] = '\0'; /* reading hostname */ in_uint8(c->in_s, sz); buf[sz] = '\0'; in_uint8a(c->in_s, buf, sz); if (0 != scp_session_set_hostname(session, buf)) { scp_session_destroy(session); log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error", __LINE__); return SCP_SERVER_STATE_INTERNAL_ERR; } /* reading username */ in_uint8(c->in_s, sz); buf[sz] = '\0'; in_uint8a(c->in_s, buf, sz); if (0 != scp_session_set_username(session, buf)) { scp_session_destroy(session); log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error", __LINE__); return SCP_SERVER_STATE_INTERNAL_ERR; } /* reading password */ in_uint8(c->in_s, sz); buf[sz] = '\0'; in_uint8a(c->in_s, buf, sz); if (0 != scp_session_set_password(session, buf)) { scp_session_destroy(session); log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error", __LINE__); return SCP_SERVER_STATE_INTERNAL_ERR; } /* returning the struct */ (*s) = session; return SCP_SERVER_STATE_OK; } enum SCP_SERVER_STATES_E scp_v1s_deny_connection(struct SCP_CONNECTION *c, const char *reason) { int rlen; init_stream(c->out_s, c->out_s->size); /* forcing message not to exceed 64k */ rlen = g_strlen(reason); if (rlen > 65535) { rlen = 65535; } out_uint32_be(c->out_s, 1); /* packet size: 4 + 4 + 2 + 2 + 2 + strlen(reason)*/ /* version + size + cmdset + cmd + msglen + msg */ out_uint32_be(c->out_s, rlen + 14); out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); out_uint16_be(c->out_s, 2); out_uint16_be(c->out_s, rlen); out_uint8p(c->out_s, reason, rlen); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, rlen + 14)) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } return SCP_SERVER_STATE_END; } enum SCP_SERVER_STATES_E scp_v1s_request_password(struct SCP_CONNECTION *c, struct SCP_SESSION *s, const char *reason) { tui8 sz; tui32 version; tui32 size; tui16 cmdset; tui16 cmd; int rlen; char buf[257]; init_stream(c->in_s, c->in_s->size); init_stream(c->out_s, c->out_s->size); /* forcing message not to exceed 64k */ rlen = g_strlen(reason); if (rlen > 65535) { rlen = 65535; } /* send password request */ version = 1; cmd = 3; out_uint32_be(c->out_s, version); /* version */ out_uint32_be(c->out_s, 14 + rlen); /* size */ out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); /* cmdset */ out_uint16_be(c->out_s, cmd); /* cmd */ out_uint16_be(c->out_s, rlen); out_uint8p(c->out_s, reason, rlen); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, 14 + rlen)) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } /* receive password & username */ if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version != 1) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: version error", __LINE__); return SCP_SERVER_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); if (size < 12) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: size error", __LINE__); return SCP_SERVER_STATE_SIZE_ERR; } init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, (size - 8))) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } in_uint16_be(c->in_s, cmdset); if (cmdset != SCP_COMMAND_SET_DEFAULT) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != 4) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } buf[256] = '\0'; /* reading username */ in_uint8(c->in_s, sz); buf[sz] = '\0'; in_uint8a(c->in_s, buf, sz); if (0 != scp_session_set_username(s, buf)) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error", __LINE__); return SCP_SERVER_STATE_INTERNAL_ERR; } /* reading password */ in_uint8(c->in_s, sz); buf[sz] = '\0'; in_uint8a(c->in_s, buf, sz); if (0 != scp_session_set_password(s, buf)) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error", __LINE__); return SCP_SERVER_STATE_INTERNAL_ERR; } return SCP_SERVER_STATE_OK; } /* 020 */ enum SCP_SERVER_STATES_E scp_v1s_request_pwd_change(struct SCP_CONNECTION *c, char *reason, char *npw) { return SCP_SERVER_STATE_INTERNAL_ERR; } /* 023 */ enum SCP_SERVER_STATES_E scp_v1s_pwd_change_error(struct SCP_CONNECTION *c, char *error, int retry, char *npw) { return SCP_SERVER_STATE_INTERNAL_ERR; } /* 030 */ enum SCP_SERVER_STATES_E scp_v1s_connect_new_session(struct SCP_CONNECTION *c, SCP_DISPLAY d) { /* send password request */ tui32 version = 1; tui32 size = 14; tui16 cmd = 30; init_stream(c->out_s, c->out_s->size); out_uint32_be(c->out_s, version); /* version */ out_uint32_be(c->out_s, size); /* size */ out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); /* cmdset */ out_uint16_be(c->out_s, cmd); /* cmd */ out_uint16_be(c->out_s, d); /* display */ if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, 14)) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } return SCP_SERVER_STATE_OK; } /* 032 */ enum SCP_SERVER_STATES_E scp_v1s_connection_error(struct SCP_CONNECTION *c, const char *error) { tui16 len; len = g_strlen(error); init_stream(c->out_s, c->out_s->size); out_uint32_be(c->out_s, 1); /* packet size: 4 + 4 + 2 + 2 + len */ /* version + size + cmdset + cmd */ out_uint32_be(c->out_s, (12 + len)); out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); out_uint16_be(c->out_s, SCP_CMD_CONN_ERROR); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, (12 + len))) { return SCP_SERVER_STATE_NETWORK_ERR; } return SCP_SERVER_STATE_END; } /* 040 */ enum SCP_SERVER_STATES_E scp_v1s_list_sessions(struct SCP_CONNECTION *c, int sescnt, struct SCP_DISCONNECTED_SESSION *ds, SCP_SID *sid) { tui32 version = 1; tui32 size = 12; tui16 cmd = 40; int pktcnt; int idx; int sidx; int pidx; struct SCP_DISCONNECTED_SESSION *cds; /* first we send a notice that we have some disconnected sessions */ init_stream(c->out_s, c->out_s->size); out_uint32_be(c->out_s, version); /* version */ out_uint32_be(c->out_s, size); /* size */ out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); /* cmdset */ out_uint16_be(c->out_s, cmd); /* cmd */ if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } /* then we wait for client ack */ /* * Maybe this message could say if the session should be resized on * server side or client side. */ init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version != 1) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: version error", __LINE__); return SCP_SERVER_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); if (size < 12) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: size error", __LINE__); return SCP_SERVER_STATE_SIZE_ERR; } init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, (size - 8))) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != SCP_COMMAND_SET_DEFAULT) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != 41) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } /* calculating the number of packets to send */ pktcnt = sescnt / SCP_SERVER_MAX_LIST_SIZE; if ((sescnt % SCP_SERVER_MAX_LIST_SIZE) != 0) { pktcnt++; } for (idx = 0; idx < pktcnt; idx++) { /* ok, we send session session list */ init_stream(c->out_s, c->out_s->size); /* size: ver+size+cmdset+cmd+sescnt+continue+count */ size = 4 + 4 + 2 + 2 + 4 + 1 + 1; /* header */ cmd = 42; s_push_layer(c->out_s, channel_hdr, 8); out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); out_uint16_be(c->out_s, cmd); /* session count */ out_uint32_be(c->out_s, sescnt); /* setting the continue flag */ if ((idx + 1)*SCP_SERVER_MAX_LIST_SIZE >= sescnt) { out_uint8(c->out_s, 0); /* setting session count for this packet */ pidx = sescnt - (idx * SCP_SERVER_MAX_LIST_SIZE); out_uint8(c->out_s, pidx); } else { out_uint8(c->out_s, 1); /* setting session count for this packet */ pidx = SCP_SERVER_MAX_LIST_SIZE; out_uint8(c->out_s, pidx); } /* adding session descriptors */ for (sidx = 0; sidx < pidx; sidx++) { /* shortcut to the current session to send */ cds = ds + ((idx) * SCP_SERVER_MAX_LIST_SIZE) + sidx; /* session data */ out_uint32_be(c->out_s, cds->SID); /* session id */ out_uint8(c->out_s, cds->type); out_uint16_be(c->out_s, cds->height); out_uint16_be(c->out_s, cds->width); out_uint8(c->out_s, cds->bpp); out_uint8(c->out_s, cds->idle_days); out_uint8(c->out_s, cds->idle_hours); out_uint8(c->out_s, cds->idle_minutes); size += 13; out_uint16_be(c->out_s, cds->conn_year); out_uint8(c->out_s, cds->conn_month); out_uint8(c->out_s, cds->conn_day); out_uint8(c->out_s, cds->conn_hour); out_uint8(c->out_s, cds->conn_minute); out_uint8(c->out_s, cds->addr_type); size += 7; if (cds->addr_type == SCP_ADDRESS_TYPE_IPV4) { in_uint32_be(c->out_s, cds->ipv4addr); size += 4; } else if (cds->addr_type == SCP_ADDRESS_TYPE_IPV6) { in_uint8a(c->out_s, cds->ipv6addr, 16); size += 16; } } s_pop_layer(c->out_s, channel_hdr); out_uint32_be(c->out_s, version); out_uint32_be(c->out_s, size); if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } } /* we get the response */ init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, (8))) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } in_uint32_be(c->in_s, version); if (version != 1) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: version error", __LINE__); return SCP_SERVER_STATE_VERSION_ERR; } in_uint32_be(c->in_s, size); if (size < 12) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: size error", __LINE__); return SCP_SERVER_STATE_SIZE_ERR; } /* rest of the packet */ init_stream(c->in_s, c->in_s->size); if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, (size - 8))) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } in_uint16_be(c->in_s, cmd); if (cmd != SCP_COMMAND_SET_DEFAULT) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } in_uint16_be(c->in_s, cmd); if (cmd == 43) { /* select session */ in_uint32_be(c->in_s, (*sid)); /* checking sid value */ for (idx = 0; idx < sescnt; idx++) { /* the sid is valid */ if (ds[idx].SID == (*sid)) { /* ok, session selected */ return SCP_SERVER_STATE_OK; } } /* if we got here, the requested sid wasn't one from the list we sent */ /* we should kill the connection */ log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error (no such session in list)", __LINE__); return SCP_SERVER_STATE_INTERNAL_ERR; } else if (cmd == 44) { /* cancel connection */ return SCP_SERVER_STATE_SELECTION_CANCEL; } // else if (cmd == 45) // { // /* force new connection */ // return SCP_SERVER_STATE_FORCE_NEW; // } else { /* wrong response */ log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: sequence error", __LINE__); return SCP_SERVER_STATE_SEQUENCE_ERR; } return SCP_SERVER_STATE_OK; } /* 046 was: 031 struct SCP_DISCONNECTED_SESSION* ds, */ enum SCP_SERVER_STATES_E scp_v1s_reconnect_session(struct SCP_CONNECTION *c, SCP_DISPLAY d) { tui32 version = 1; tui32 size = 14; tui16 cmd = 46; /* ok, we send session data and display */ init_stream(c->out_s, c->out_s->size); /* header */ out_uint32_be(c->out_s, version); out_uint32_be(c->out_s, size); out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); out_uint16_be(c->out_s, cmd); /* session data */ out_uint16_be(c->out_s, d); /* session display */ /*out_uint8(c->out_s, ds->type); out_uint16_be(c->out_s, ds->height); out_uint16_be(c->out_s, ds->width); out_uint8(c->out_s, ds->bpp); out_uint8(c->out_s, ds->idle_days); out_uint8(c->out_s, ds->idle_hours); out_uint8(c->out_s, ds->idle_minutes);*/ /* these last three are not really needed... */ if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size)) { log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: network error", __LINE__); return SCP_SERVER_STATE_NETWORK_ERR; } return SCP_SERVER_STATE_OK; } #endif xrdp-0.9.12/sesman/libscp/libscp_v1c_mng.h000644 001751 001751 00000002667 13544635323 020324 0ustar00metameta000000 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 libscp_v1c_mng.h * @brief libscp version 1 client api declarations - session management * @author Simone Fedele * */ #ifndef LIBSCP_V1C_MNG_H #define LIBSCP_V1C_MNG_H #include "libscp.h" /* client API */ /* 001 */ enum SCP_CLIENT_STATES_E scp_v1c_mng_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s); /* 004 * / enum SCP_CLIENT_STATES_E scp_v1c_resend_credentials(struct SCP_CONNECTION* c, struct SCP_SESSION* s); / * 021 * / enum SCP_CLIENT_STATES_E scp_v1c_pwd_change(struct SCP_CONNECTION* c, char* newpass); / * 022 * / enum SCP_CLIENT_STATES_E scp_v1c_pwd_change_cancel(struct SCP_CONNECTION* c); */ /* 041 */ enum SCP_CLIENT_STATES_E scp_v1c_mng_get_session_list(struct SCP_CONNECTION* c, int* scount, struct SCP_DISCONNECTED_SESSION** s); #endif xrdp-0.9.12/sesman/libscp/libscp_vX.h000644 001751 001751 00000002326 13544635323 017357 0ustar00metameta000000 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 libscp_vX.h * @brief libscp version neutral code header * @author Simone Fedele * */ #ifndef LIBSCP_VX_H #define LIBSCP_VX_H #include "libscp_types.h" #include "libscp_v0.h" #include "libscp_v1s.h" /* server API */ /** * * @brief version neutral server accept function * @param c connection descriptor * @param s session descriptor pointer address. * it will return a newly allocated descriptor. * It this memory needs to be g_free()d * */ enum SCP_SERVER_STATES_E scp_vXs_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s); #endif xrdp-0.9.12/sesman/libscp/Makefile.am000644 001751 001751 00000001606 13544635323 017311 0ustar00metameta000000 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 if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif module_LTLIBRARIES = \ libscp.la libscp_la_SOURCES = \ libscp.h \ libscp_commands.h \ libscp_commands_mng.h \ libscp_connection.c \ libscp_connection.h \ libscp_init.c \ libscp_init.h \ libscp_lock.c \ libscp_lock.h \ libscp_session.c \ libscp_session.h \ libscp_tcp.c \ libscp_tcp.h \ libscp_types.h \ libscp_types_mng.h \ libscp_v0.c \ libscp_v0.h \ libscp_v1c.c \ libscp_v1c.h \ libscp_v1c_mng.c \ libscp_v1c_mng.h \ libscp_v1s.c \ libscp_v1s.h \ libscp_v1s_mng.c \ libscp_v1s_mng.h \ libscp_vX.c \ libscp_vX.h libscp_la_LIBADD = \ $(top_builddir)/common/libcommon.la \ -lpthread xrdp-0.9.12/sesman/libscp/libscp_init.h000644 001751 001751 00000002137 13544635323 017725 0ustar00metameta000000 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 libscp_init.h * @brief libscp initialization code header * @author Simone Fedele * */ #ifndef LIBSCP_INIT_H #define LIBSCP_INIT_H #include "log.h" #include "libscp.h" /** * * @brief version neutral server accept function * @param c connection descriptor * @param s session descriptor pointer address. * it will return a newly allocated descriptor. * It this memory needs to be g_free()d * */ int scp_init(void); #endif xrdp-0.9.12/librfxcodec/include/000755 001751 001751 00000000000 13601646134 016413 5ustar00metameta000000 000000 xrdp-0.9.12/librfxcodec/install-sh000755 001751 001751 00000036010 13601646121 016770 0ustar00metameta000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # 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 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 the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? 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 '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac 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 && $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 # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook '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.9.12/librfxcodec/m4/000755 001751 001751 00000000000 13601646134 015310 5ustar00metameta000000 000000 xrdp-0.9.12/librfxcodec/aclocal.m4000644 001751 001751 00000122454 13601646120 016633 0ustar00metameta000000 000000 # generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 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.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 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-2018 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-2018 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 thusly: # 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-2018 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. 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-2018 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 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_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # 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 ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 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-2018 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-2018 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-2018 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 case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac 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-2018 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-2018 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) 2001-2018 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-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 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-2018 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-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/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.9.12/librfxcodec/compile000755 001751 001751 00000016327 13601646121 016353 0ustar00metameta000000 000000 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 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*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]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.9.12/librfxcodec/ltmain.sh000644 001751 001751 00001170771 13601646117 016627 0ustar00metameta000000 000000 #! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 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.6 package_revision=2.4.6 ## ------ ## ## 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=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 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. # 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. # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## 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 # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # 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 ## ------------------------- ## ## 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" ## ----------------- ## ## 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_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_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_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg 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. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # 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_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_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_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_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 # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 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. # 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## 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 '# warranty; '. # # 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 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 # to the main code. A hook is just a named list of of function, 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 functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is 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 funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # 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=: ;; # # 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 # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # 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_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse 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 [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_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 propogate 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+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # 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+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break 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 ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # 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+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## 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#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' 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. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # 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: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # 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.6 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= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _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; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } 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_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_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_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_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_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_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 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 -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_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_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_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_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_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$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\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $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_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in 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 ;; 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*) # 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*) # 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 ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-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_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # 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 # -stdlib=* select c++ std lib with clang -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=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_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_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_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_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test 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|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) 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*) # 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_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test 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_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test 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_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do 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_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` 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.9.12/librfxcodec/config.guess000755 001751 001751 00000126014 13601646121 017310 0ustar00metameta000000 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.9.12/librfxcodec/rfxcodec.pc.in000644 001751 001751 00000000374 13017154341 017515 0ustar00metameta000000 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.9.12/librfxcodec/missing000755 001751 001751 00000015336 13601646121 016373 0ustar00metameta000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: xrdp-0.9.12/librfxcodec/depcomp000755 001751 001751 00000056020 13601646122 016345 0ustar00metameta000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 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 . EOF exit $? ;; -v | --v*) echo "depcomp $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 digits=0123456789 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 interferences 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 obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB 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.9.12/librfxcodec/readme.txt000644 001751 001751 00000000324 12446253657 016777 0ustar00metameta000000 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.9.12/librfxcodec/Makefile.am000644 001751 001751 00000000202 13061652764 017024 0ustar00metameta000000 000000 ACLOCAL_AMFLAGS = -I m4 pkgconfig_DATA = rfxcodec.pc EXTRA_DIST = bootstrap readme.txt SUBDIRS = \ include \ src \ tests xrdp-0.9.12/librfxcodec/configure000755 001751 001751 00001547426 13601646121 016716 0ustar00metameta000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for rfxcodec 0.1.5. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 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 -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_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 exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && 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 as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else 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 test -z "$as_dir" && as_dir=. 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_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS 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'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$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 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=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" 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.5' PACKAGE_STRING='rfxcodec 0.1.5' PACKAGE_BUGREPORT='xrdp-devel@googlegroups.com' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS WITH_SIMD_X86_FALSE WITH_SIMD_X86_TRUE WITH_SIMD_AMD64_FALSE WITH_SIMD_AMD64_TRUE NAFLAGS NASM pkgconfigdir CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP 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_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V 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 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 ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP' # 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' 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 # Accept the important Cygnus configure options, so we can diagnose typos. 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=`$as_echo "$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=`$as_echo "$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 ;; -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=`$as_echo "$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=`$as_echo "$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. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` 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" ;; *) $as_echo "$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 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 || $as_echo 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.5 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] --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.5:";; 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) 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. CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$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.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF 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 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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_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$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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # 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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status 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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #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 (); /* 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 () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func 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.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _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 test -z "$as_dir" && as_dir=. $as_echo "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=`$as_echo "$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=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$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 $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$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=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`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.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. 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=`$as_echo "$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 case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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 (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." 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.5' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # 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 -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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. $as_echo "$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\"" $as_echo "$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 $as_echo "$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 () { ; 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$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+set}" = set && 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 ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$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 () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -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 **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF 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 test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "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.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' 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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". 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 thusly: # 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #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}; /* AIX 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; } { /* AIX 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 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "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*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$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+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else 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 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else 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* | 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 fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #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 fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$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}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else 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='/usr/bin/file -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*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-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=/usr/bin/file 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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=$? $as_echo "$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=$? $as_echo "$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.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # 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++, # 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=$? $as_echo "$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=$? $as_echo "$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=$? $as_echo "$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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no 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|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else 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" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$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+set}" = set; 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else 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 cru libconftest.a conftest.o" >&5 $AR cru 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$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*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test 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_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "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 ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue 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 # Passes both tests. ac_preproc_ok=: break 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 fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue 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 # Passes both tests. ac_preproc_ok=: break 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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : 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 : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; 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 enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; 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 enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; 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 pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; 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 enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; 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 if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF 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, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$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\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "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++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) 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 ;; 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 == "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 ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi 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 ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi 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++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC 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 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*) 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) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else 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 lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$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 ;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $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=$? $as_echo "$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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "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*) # Native MSVC 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 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*) # 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 ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; 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$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$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 lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$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 fi fi fi fi 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else 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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$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\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else 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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$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+set}" = set; then : withval=$with_pkgconfigdir; else with_pkgconfigdir='${libdir}/pkgconfig' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5 $as_echo_n "checking CFLAGS for maximum warnings... " >&6; } if ${ac_cv_cflags_warn_all+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; 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.$ac_ext done CFLAGS="$ac_save_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 $as_echo "$ac_cv_cflags_warn_all" >&6; } case ".$ac_cv_cflags_warn_all" in .ok|.ok,*) ;; .|.no|.no,*) ;; *) if ${CFLAGS+:} false; then : case " $CFLAGS " in #( *" $ac_cv_cflags_warn_all "*) : { { $as_echo "$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $ac_cv_cflags_warn_all" { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else CFLAGS=$ac_cv_cflags_warn_all { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 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=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in #( *" $flag "*) : { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $flag" { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else CFLAGS=$flag { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi else : fi done # SIMD is optional # Check whether --with-simd was given. if test "${with_simd+set}" = set; then : withval=$with_simd; fi if test "x${with_simd}" != "xno"; then # Check if we're on a supported CPU { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have SIMD optimisations for cpu type" >&5 $as_echo_n "checking if we have SIMD optimisations for cpu type... " >&6; } case "$host_cpu" in x86_64 | amd64) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (x86_64)" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NASM+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NASM="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NASM=$ac_cv_prog_NASM if test -n "$NASM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NASM" >&5 $as_echo "$NASM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$NASM" && break done test -z "$NASM" && as_fn_error $? "no nasm (Netwide Assembler) found" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for object file format of host system" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $objfmt" >&5 $as_echo "$objfmt" >&6; } if test "$objfmt" = 'ELF ?'; then objfmt='ELF' { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unexpected host system. assumed that the format is $objfmt." >&5 $as_echo "$as_me: WARNING: unexpected host system. assumed that the format is $objfmt." >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for object file format specifier (NAFLAGS) " >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NAFLAGS" >&5 $as_echo "$NAFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the assembler ($NASM $NAFLAGS) works" >&5 $as_echo_n "checking whether the assembler ($NASM $NAFLAGS) works... " >&6; } cat > conftest.asm <&5 (eval $try_nasm) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest-nasm.o; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else echo "configure: failed program was:" >&5 cat conftest.asm >&5 rm -rf conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "installation or configuration problem: assembler cannot create object files." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts assembler output" >&5 $as_echo_n "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 () { nasmfunc(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : nasm_link_ok=yes else nasm_link_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$nasm_save_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nasm_link_ok" >&5 $as_echo "$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 $as_echo "#define RFX_USE_ACCEL_AMD64 1" >>confdefs.h ;; i*86 | x86 | ia32) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (i386)" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NASM+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NASM="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NASM=$ac_cv_prog_NASM if test -n "$NASM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NASM" >&5 $as_echo "$NASM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$NASM" && break done test -z "$NASM" && as_fn_error $? "no nasm (Netwide Assembler) found" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for object file format of host system" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $objfmt" >&5 $as_echo "$objfmt" >&6; } if test "$objfmt" = 'ELF ?'; then objfmt='ELF' { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unexpected host system. assumed that the format is $objfmt." >&5 $as_echo "$as_me: WARNING: unexpected host system. assumed that the format is $objfmt." >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for object file format specifier (NAFLAGS) " >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NAFLAGS" >&5 $as_echo "$NAFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the assembler ($NASM $NAFLAGS) works" >&5 $as_echo_n "checking whether the assembler ($NASM $NAFLAGS) works... " >&6; } cat > conftest.asm <&5 (eval $try_nasm) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest-nasm.o; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else echo "configure: failed program was:" >&5 cat conftest.asm >&5 rm -rf conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "installation or configuration problem: assembler cannot create object files." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts assembler output" >&5 $as_echo_n "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 () { nasmfunc(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : nasm_link_ok=yes else nasm_link_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$nasm_save_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nasm_link_ok" >&5 $as_echo "$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 $as_echo "#define RFX_USE_ACCEL_X86 1" >>confdefs.h ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (\"$host_cpu\")" >&5 $as_echo "no (\"$host_cpu\")" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SIMD support not available for this CPU. Performance will suffer." >&5 $as_echo "$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 ac_config_files="$ac_config_files Makefile include/Makefile src/Makefile src/amd64/Makefile src/x86/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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$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+set}" = set || &/ 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 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$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=`$as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' 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 : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$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 -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _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.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _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 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ rfxcodec config.status 0.1.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$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 ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$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 ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _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 \$as_echo "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 $as_echo "$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"`' 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"`' 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 \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ 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" ;; "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+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason 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=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _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@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _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"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && 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 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$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 $as_echo "/* $configure_input */" \ && 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 || $as_echo 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) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # 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=`$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" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo 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 || $as_echo 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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. 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 # 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. AR_FLAGS=$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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi xrdp-0.9.12/librfxcodec/rfxcodec-uninstalled.pc.in000644 001751 001751 00000000337 13017154341 022034 0ustar00metameta000000 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.9.12/librfxcodec/bootstrap000755 001751 001751 00000000630 13017154341 016725 0ustar00metameta000000 000000 #!/bin/sh which autoconf if ! test $? -eq 0 then echo "error, install autoconf" exit 1 fi which automake if ! test $? -eq 0 then echo "error, install automake" exit 1 fi which libtool || which libtoolize if ! test $? -eq 0 then echo "error, install libtool" exit 1 fi which pkg-config if ! test $? -eq 0 then echo "error, install pkg-config" exit 1 fi touch configure.ac autoreconf -fvi xrdp-0.9.12/librfxcodec/config_ac-h.in000644 001751 001751 00000003422 13601646121 017452 0ustar00metameta000000 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_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* 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 you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const xrdp-0.9.12/librfxcodec/config.sub000755 001751 001751 00000105526 13601646121 016760 0ustar00metameta000000 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.9.12/librfxcodec/tests/000755 001751 001751 00000000000 13601646134 016132 5ustar00metameta000000 000000 xrdp-0.9.12/librfxcodec/configure.ac000644 001751 001751 00000003063 13526537471 017271 0ustar00metameta000000 000000 # Process this file with autoconf to produce a configure script AC_PREREQ(2.59) AC_INIT([rfxcodec], [0.1.5], [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 AC_PROG_LIBTOOL PKG_INSTALLDIR AX_CFLAGS_WARN_ALL AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) # SIMD is optional AC_ARG_WITH([simd], AC_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]) AC_CONFIG_FILES([Makefile include/Makefile src/Makefile src/amd64/Makefile src/x86/Makefile tests/Makefile rfxcodec.pc rfxcodec-uninstalled.pc ]) AC_OUTPUT xrdp-0.9.12/librfxcodec/Makefile.in000644 001751 001751 00000067426 13601646121 017050 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags CSCOPE = cscope 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 -200 -exec chmod u+w {} ';' \ && 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 = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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 @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config_ac.h $(srcdir)/config_ac-h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 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) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @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-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ 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) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-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 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: xrdp-0.9.12/librfxcodec/src/000755 001751 001751 00000000000 13601646134 015557 5ustar00metameta000000 000000 xrdp-0.9.12/librfxcodec/src/rfx_bitstream.h000644 001751 001751 00000005076 13127342076 020612 0ustar00metameta000000 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.9.12/librfxcodec/src/rfxencode_quantization.h000644 001751 001751 00000001557 12777440111 022523 0ustar00metameta000000 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); #endif /* __RFX_QUANTIZATION_H */ xrdp-0.9.12/librfxcodec/src/rfxencode_alpha.h000644 001751 001751 00000001561 13061652764 021063 0ustar00metameta000000 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.9.12/librfxcodec/src/rfxencode_rlgr3.h000644 001751 001751 00000001515 13061652764 021026 0ustar00metameta000000 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.9.12/librfxcodec/src/rfxencode_diff_rlgr3.h000644 001751 001751 00000001533 13061652764 022016 0ustar00metameta000000 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); #endif /* __RFX_DIFF_RLGR3_H */ xrdp-0.9.12/librfxcodec/src/rfxencode_differential.h000644 001751 001751 00000001572 12446253657 022440 0ustar00metameta000000 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.9.12/librfxcodec/src/rfxconstants.h000644 001751 001751 00000003354 12777440111 020471 0ustar00metameta000000 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 /* 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.9.12/librfxcodec/src/rfxencode_dwt.c000644 001751 001751 00000015177 13127342056 020570 0ustar00metameta000000 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" /******************************************************************************/ static int rfx_dwt_2d_encode_horz(sint16 *buffer, sint16 *dwt, int subband_width) { 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 = buffer + subband_width * subband_width * 3; hl = buffer; l_src = dwt; lh = buffer + subband_width * subband_width; hh = buffer + subband_width * subband_width * 2; h_src = dwt + 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 *buffer, sint16 *dwt, 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 dwt. */ for (x = 0; x < total_width; x++) { /* pre */ l = dwt + x; h = l + subband_width * total_width; src = 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 = dwt + n * total_width + x; h = l + subband_width * total_width; src = 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 = dwt + n * total_width + x; h = l + subband_width * total_width; src = 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(buffer, dwt, subband_width); } /******************************************************************************/ static int rfx_dwt_2d_encode_block8(const uint8 *in_buffer, sint16 *buffer, sint16 *dwt, 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 dwt. */ for (x = 0; x < total_width; x++) { /* pre */ l = dwt + 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 = dwt + 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 = dwt + 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(buffer, dwt, subband_width); } /******************************************************************************/ int rfx_dwt_2d_encode(const uint8 *in_buffer, sint16 *buffer, sint16 *dwt_buffer) { rfx_dwt_2d_encode_block8(in_buffer, buffer, dwt_buffer, 32); rfx_dwt_2d_encode_block(buffer + 3072, dwt_buffer, 16); rfx_dwt_2d_encode_block(buffer + 3840, dwt_buffer, 8); return 0; } xrdp-0.9.12/librfxcodec/src/Makefile.am000644 001751 001751 00000002074 13220730305 017605 0ustar00metameta000000 000000 EXTRA_DIST = common.asm nasm_lt.sh SUBDIRS = AM_CPPFLAGS = \ -I$(top_srcdir)/include if WITH_SIMD_AMD64 SUBDIRS += amd64 librfxencode_la_LIBADD = amd64/librfxencode-amd64.la AM_CPPFLAGS += -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_AMD64=1 endif if WITH_SIMD_X86 SUBDIRS += x86 librfxencode_la_LIBADD = x86/librfxencode-x86.la AM_CPPFLAGS += -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_rgb_to_yuv.h lib_LTLIBRARIES = librfxencode.la 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 xrdp-0.9.12/librfxcodec/src/rfxencode_compose.h000644 001751 001751 00000002231 13127342076 021431 0ustar00metameta000000 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); #endif xrdp-0.9.12/librfxcodec/src/rfxencode_diff_rlgr1.h000644 001751 001751 00000001533 13061652764 022014 0ustar00metameta000000 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); #endif /* __RFX_DIFF_RLGR1_H */ xrdp-0.9.12/librfxcodec/src/rfxencode.h000644 001751 001751 00000004311 13220730305 017673 0ustar00metameta000000 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); 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 pad0[7]; 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]; uint8 pad2[16]; sint16 *dwt_buffer; sint16 *dwt_buffer1; sint16 *dwt_buffer2; 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; int got_sse2; int got_sse3; int got_sse41; int got_sse42; int got_sse4a; int got_popcnt; int got_lzcnt; int got_neon; }; #endif xrdp-0.9.12/librfxcodec/src/Makefile.in000644 001751 001751 00000070515 13601646122 017631 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WITH_SIMD_AMD64_TRUE@am__append_1 = amd64 @WITH_SIMD_AMD64_TRUE@am__append_2 = -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_AMD64=1 @WITH_SIMD_X86_TRUE@am__append_3 = x86 @WITH_SIMD_X86_TRUE@am__append_4 = -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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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_TRUE@librfxencode_la_DEPENDENCIES = \ @WITH_SIMD_AMD64_TRUE@ amd64/librfxencode-amd64.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 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 = 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_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)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = amd64 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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) @WITH_SIMD_AMD64_TRUE@librfxencode_la_LIBADD = amd64/librfxencode-amd64.la @WITH_SIMD_X86_TRUE@librfxencode_la_LIBADD = x86/librfxencode-x86.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_rgb_to_yuv.h lib_LTLIBRARIES = librfxencode.la 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 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: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } librfxencode.la: $(librfxencode_la_OBJECTS) $(librfxencode_la_DEPENDENCIES) $(EXTRA_librfxencode_la_DEPENDENCIES) $(AM_V_CCLD)$(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_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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-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_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_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: xrdp-0.9.12/librfxcodec/src/rfxencode_rlgr1.h000644 001751 001751 00000001515 13061652764 021024 0ustar00metameta000000 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.9.12/librfxcodec/src/rfxencode_tile.h000644 001751 001751 00000010204 13127342056 020716 0ustar00metameta000000 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.9.12/librfxcodec/src/rfxencode_rgb_to_yuv.c000644 001751 001751 00000034500 13526537471 022152 0ustar00metameta000000 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" #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.9.12/librfxcodec/src/rfxencode_dwt.h000644 001751 001751 00000001424 13127342056 020563 0ustar00metameta000000 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_H #define __RFXENCODE_RFX_H int rfx_dwt_2d_encode(const uint8 *in_buffer, sint16 *buffer, sint16 *dwt_buffer); #endif xrdp-0.9.12/librfxcodec/src/nasm_lt.sh000755 001751 001751 00000003044 13061652764 017562 0ustar00metameta000000 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.9.12/librfxcodec/src/rfxencode_diff_rlgr3.c000644 001751 001751 00000014573 13127342076 022014 0ustar00metameta000000 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" #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) \ { \ 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; \ while (llvk >= 8) \ { \ bits <<= 8; \ bits |= 0xFF; \ llvk -= 8; \ *cdata = bits >> bit_count; \ cdata++; \ } \ bits <<= llvk; \ bits |= (1 << llvk) - 1; \ bit_count += llvk; \ bits <<= 1; \ bit_count++; \ CheckWrite; \ /* 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) int rfx_encode_diff_rlgr3(sint16 *coef, uint8 *cdata, int cdata_size) { 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 64 bytes are diff */ for (k = PIXELS_IN_TILE - 1; k > PIXELS_IN_TILE - 64; 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 && coef_size > 0) { numZeros++; 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; /* 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 ? mag - 1 : 0; 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) { bits <<= 8 - bit_count; *cdata = bits; cdata++; bit_count = 0; } processed_size = cdata - cdata_org; return processed_size; } xrdp-0.9.12/librfxcodec/src/rfxencode_differential.c000644 001751 001751 00000002352 13061652764 022424 0ustar00metameta000000 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" /******************************************************************************/ 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.9.12/librfxcodec/src/rfxencode_rlgr3.c000644 001751 001751 00000014566 13061652764 021033 0ustar00metameta000000 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" /* 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 && data_size > 0) { numZeros++; 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); /* note: when we reach here and the last byte being encoded is 0, we still need to output the last two bits, otherwise mstsc will crash */ /* 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 ? mag - 1 : 0; 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.9.12/librfxcodec/src/common.asm000644 001751 001751 00000005115 13162371073 017552 0ustar00metameta000000 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.9.12/librfxcodec/src/rfxcommon.h000644 001751 001751 00000010050 13127342056 017733 0ustar00metameta000000 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_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.9.12/librfxcodec/src/rfxencode_quantization.c000644 001751 001751 00000010546 13127342056 022513 0ustar00metameta000000 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" #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 /******************************************************************************/ 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; } xrdp-0.9.12/librfxcodec/src/rfxencode_alpha.c000644 001751 001751 00000015447 13127342056 021057 0ustar00metameta000000 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" #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.9.12/librfxcodec/src/rfxencode_tile.c000644 001751 001751 00000022176 13220730305 020714 0ustar00metameta000000 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" #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) /******************************************************************************/ 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; } /******************************************************************************/ 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 (enc->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 (enc->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 (enc->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 (enc->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 (enc->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 (enc->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 (enc->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 (enc->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 (enc->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 (enc->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 (enc->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 (enc->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.9.12/librfxcodec/src/rfxencode_rgb_to_yuv.h000644 001751 001751 00000002076 13220730305 022140 0ustar00metameta000000 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.9.12/librfxcodec/src/amd64/000755 001751 001751 00000000000 13601646134 016472 5ustar00metameta000000 000000 xrdp-0.9.12/librfxcodec/src/rfxencode_rlgr1.c000644 001751 001751 00000014101 13061652764 021012 0ustar00metameta000000 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" /* 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 && data_size > 0) { numZeros++; 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); /* note: when we reach here and the last byte being encoded is 0, we still need to output the last two bits, otherwise mstsc will crash */ /* 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 ? mag - 1 : 0; 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.9.12/librfxcodec/src/x86/000755 001751 001751 00000000000 13601646134 016204 5ustar00metameta000000 000000 xrdp-0.9.12/librfxcodec/src/rfxencode_compose.c000644 001751 001751 00000050702 13127342076 021432 0ustar00metameta000000 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" #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; } 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 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); 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) { return 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) { return 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) { return 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) { return 1; } } } } tilesDataSize = stream_get_pos(s) - end_pos; size += tilesDataSize; end_pos = stream_get_pos(s); stream_set_pos(s, start_pos + 2); stream_write_uint32(s, size); /* CodecChannelT.blockLen */ stream_set_pos(s, start_pos + 18); stream_write_uint32(s, tilesDataSize); stream_set_pos(s, end_pos); return 0; } /******************************************************************************/ 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) { if (rfx_compose_message_frame_begin(enc, s) != 0) { return 1; } if (rfx_compose_message_region(enc, s, regions, num_regions) != 0) { return 1; } if (rfx_compose_message_tileset(enc, s, buf, width, height, stride_bytes, tiles, num_tiles, quants, num_quants, flags) != 0) { return 1; } if (rfx_compose_message_frame_end(enc, s) != 0) { return 1; } return 0; } xrdp-0.9.12/librfxcodec/src/rfxencode_diff_rlgr1.c000644 001751 001751 00000013074 13127342076 022005 0ustar00metameta000000 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" #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) \ { \ 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; \ while (llvk >= 8) \ { \ bits <<= 8; \ bits |= 0xFF; \ llvk -= 8; \ *cdata = bits >> bit_count; \ cdata++; \ } \ bits <<= llvk; \ bits |= (1 << llvk) - 1; \ bit_count += llvk; \ bits <<= 1; \ bit_count++; \ CheckWrite; \ /* 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) int rfx_encode_diff_rlgr1(sint16 *coef, uint8 *cdata, int cdata_size) { 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 64 bytes are diff */ for (k = PIXELS_IN_TILE - 1; k > PIXELS_IN_TILE - 64; 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 && coef_size > 0) { numZeros++; 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; /* 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 ? mag - 1 : 0; 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) { bits <<= 8 - bit_count; *cdata = bits; cdata++; bit_count = 0; } processed_size = cdata - cdata_org; return processed_size; } xrdp-0.9.12/librfxcodec/src/rfxencode.c000644 001751 001751 00000027336 13220730305 017702 0ustar00metameta000000 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" #ifdef RFX_USE_ACCEL_X86 #include "x86/funcs_x86.h" #endif #ifdef RFX_USE_ACCEL_AMD64 #include "amd64/funcs_amd64.h" #endif /******************************************************************************/ 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); #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; /* assign encoding functions */ 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; } 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; STREAM s; enc = (struct rfxencode *) handle; s.data = (uint8 *) cdata; s.p = s.data; s.size = *cdata_bytes; /* 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; } } if (rfx_compose_message_data(enc, &s, regions, num_regions, buf, width, height, stride_bytes, tiles, num_tiles, quants, num_quants, flags) != 0) { return 1; } *cdata_bytes = (int) (s.p - s.data); return 0; } /******************************************************************************/ 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; #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; #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; #endif return 0; } xrdp-0.9.12/librfxcodec/src/x86/rfxencode_tile_x86.c000644 001751 001751 00000007232 13061652764 022061 0ustar00metameta000000 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); 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); 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); 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); return 0; } xrdp-0.9.12/librfxcodec/src/x86/rfxcodec_encode_dwt_shift_x86_sse41.asm000644 001751 001751 00000107073 13162371073 025626 0ustar00metameta000000 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.9.12/librfxcodec/src/x86/funcs_x86.h000644 001751 001751 00000003070 13061652764 020206 0ustar00metameta000000 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.9.12/librfxcodec/src/x86/cpuid_x86.asm000644 001751 001751 00000001035 13162371073 020515 0ustar00metameta000000 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.9.12/librfxcodec/src/x86/rfxcodec_encode_dwt_shift_x86_sse2.asm000644 001751 001751 00000114002 13162371073 025531 0ustar00metameta000000 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.9.12/librfxcodec/src/x86/Makefile.in000644 001751 001751 00000044641 13601646122 020257 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/librfxcodec/src/x86/Makefile.am000644 001751 001751 00000001147 13162371073 020242 0ustar00metameta000000 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.9.12/librfxcodec/src/amd64/rfxencode_tile_amd64.c000644 001751 001751 00000007316 13061652764 022640 0ustar00metameta000000 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 "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); 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); 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); 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); return 0; } xrdp-0.9.12/librfxcodec/src/amd64/funcs_amd64.h000644 001751 001751 00000003120 13061652764 020756 0ustar00metameta000000 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.9.12/librfxcodec/src/amd64/cpuid_amd64.asm000644 001751 001751 00000001045 13162371073 021272 0ustar00metameta000000 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.9.12/librfxcodec/src/amd64/Makefile.in000644 001751 001751 00000044742 13601646122 020547 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/librfxcodec/src/amd64/rfxcodec_encode_dwt_shift_amd64_sse41.asm000644 001751 001751 00000105321 13162371073 026374 0ustar00metameta000000 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 ;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 ; save registers push rbx push rdx push rcx push rsi push rdi 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 ret END_OF_FILE xrdp-0.9.12/librfxcodec/src/amd64/Makefile.am000644 001751 001751 00000001172 13162371073 020526 0ustar00metameta000000 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.9.12/librfxcodec/src/amd64/rfxcodec_encode_dwt_shift_amd64_sse2.asm000644 001751 001751 00000112230 13162371073 026306 0ustar00metameta000000 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 ;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 ; save registers push rbx push rdx push rcx push rsi push rdi 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 ret END_OF_FILE xrdp-0.9.12/librfxcodec/tests/rfxcodectest.c000644 001751 001751 00000026047 13127342056 021003 0ustar00metameta000000 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 != 0) { 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 != 0) { 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.9.12/librfxcodec/tests/rfxencode.c000644 001751 001751 00000017266 13127342056 020266 0ustar00metameta000000 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; } 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; } int process(void) { char *out_data; char *bmp_data; int out_fd; int out_bytes; 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 != 0) { 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.9.12/librfxcodec/tests/readme.txt000644 001751 001751 00000000262 12446253657 020142 0ustar00metameta000000 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.9.12/librfxcodec/tests/Makefile.am000644 001751 001751 00000000456 13061652764 020201 0ustar00metameta000000 000000 EXTRA_DIST = readme.txt AM_CPPFLAGS = \ -I$(top_srcdir)/include check_PROGRAMS = rfxcodectest rfxencode rfxcodectest_SOURCES = rfxcodectest.c rfxencode_SOURCES = rfxencode.c rfxcodectest_LDADD = \ $(top_builddir)/src/librfxencode.la rfxencode_LDADD = \ $(top_builddir)/src/librfxencode.la xrdp-0.9.12/librfxcodec/tests/Makefile.in000644 001751 001751 00000044732 13601646122 020206 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = rfxcodectest$(EXEEXT) rfxencode$(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_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 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) DIST_SOURCES = $(rfxcodectest_SOURCES) $(rfxencode_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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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 rfxcodectest_LDADD = \ $(top_builddir)/src/librfxencode.la rfxencode_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: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list 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) 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 $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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 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 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: xrdp-0.9.12/librfxcodec/m4/libtool.m4000644 001751 001751 00001125073 13601646117 017230 0ustar00metameta000000 000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 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 58 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_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, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_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 cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru 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*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test 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], [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 `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out 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 `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; 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 `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file 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 `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file 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 `/usr/bin/file 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} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [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* | 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 -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_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*) # Native MSVC 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 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*) # 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='/usr/bin/file -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*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-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=/usr/bin/file 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++, # 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*) # 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 == "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*) _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++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) 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 ;; 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 == "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++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _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 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*) _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 ;; 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*) # Native MSVC # 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 ;; 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*) # 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_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.9.12/librfxcodec/m4/lt~obsolete.m4000644 001751 001751 00000013774 13601646117 020141 0ustar00metameta000000 000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 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.9.12/librfxcodec/m4/ax_append_flag.m4000644 001751 001751 00000005333 13127342056 020505 0ustar00metameta000000 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.9.12/librfxcodec/m4/ltoptions.m4000644 001751 001751 00000034262 13601646117 017615 0ustar00metameta000000 000000 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 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.9.12/librfxcodec/m4/ax_cflags_warn_all.m4000644 001751 001751 00000011703 13127342056 021361 0ustar00metameta000000 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.9.12/librfxcodec/m4/nasm.m4000644 001751 001751 00000006427 13061652764 016527 0ustar00metameta000000 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 <&AC_FD_CC cat conftest.asm >&AC_FD_CC 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.9.12/librfxcodec/m4/ltversion.m4000644 001751 001751 00000001273 13601646117 017603 0ustar00metameta000000 000000 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 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 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) xrdp-0.9.12/librfxcodec/m4/ax_append_compile_flags.m4000644 001751 001751 00000005660 13127342056 022403 0ustar00metameta000000 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.9.12/librfxcodec/m4/ax_require_defined.m4000644 001751 001751 00000002302 13127342056 021370 0ustar00metameta000000 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.9.12/librfxcodec/m4/ax_check_compile_flag.m4000644 001751 001751 00000006403 13127342056 022022 0ustar00metameta000000 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.9.12/librfxcodec/m4/ltsugar.m4000644 001751 001751 00000010440 13601646117 017233 0ustar00metameta000000 000000 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 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.9.12/librfxcodec/m4/pkg.m4000644 001751 001751 00000024011 13035113357 016326 0ustar00metameta000000 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.9.12/librfxcodec/include/rfxcodec_encode.h000644 001751 001751 00000010076 13220730305 021671 0ustar00metameta000000 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); typedef int (*rfxencode_diff_rlgr3_proc)(short *coef, unsigned char *cdata, int cdata_size); 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); 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; }; int rfxcodec_encode_get_internals(struct rfxcodec_encode_internals *internals); #endif xrdp-0.9.12/librfxcodec/include/rfxcodec_decode.h000644 001751 001751 00000002004 12777440111 021660 0ustar00metameta000000 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.9.12/librfxcodec/include/Makefile.am000644 001751 001751 00000000124 13061652764 020452 0ustar00metameta000000 000000 include_HEADERS = \ rfxcodec_encode.h \ rfxcodec_decode.h \ rfxcodec_common.h xrdp-0.9.12/librfxcodec/include/Makefile.in000644 001751 001751 00000040554 13601646122 020465 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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__tar = @am__tar@ am__untar = @am__untar@ 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@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/librfxcodec/include/rfxcodec_common.h000644 001751 001751 00000002302 12777440111 021726 0ustar00metameta000000 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_RLGR3 0 /* default */ #define RFX_FLAGS_RLGR1 1 #define RFX_FLAGS_ALPHAV1 1 /* used in flags for rfxcodec_encode */ #endif xrdp-0.9.12/xrdpapi/xrdpapi.c000644 001751 001751 00000033716 13544635324 016005 0ustar00metameta000000 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 #define LOG_LEVEL 1 #define LLOG(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0) #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { printf _args ; printf("\n"); } } while (0) #include #include #include #include #include #include #include #include #include #include #include #include "xrdp_sockets.h" #include "xrdpapi.h" struct wts_obj { int fd; int display_num; }; /* helper functions used by WTSxxx API - do not invoke directly */ static int get_display_num_from_display(char *display_text); static int can_send(int sck, int millis); static int can_recv(int sck, int millis); 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; char *display_text; int bytes; unsigned long long1; struct sockaddr_un s; char *connect_data; int chan_name_bytes; int lerrno; if (SessionId != WTS_CURRENT_SESSION) { LLOGLN(0, ("WTSVirtualChannelOpenEx: bad SessionId")); return 0; } wts = (struct wts_obj *) calloc(1, sizeof(struct wts_obj)); if (wts == NULL) { LLOGLN(0, ("WTSVirtualChannelOpenEx: calloc failed")); return 0; } wts->fd = -1; display_text = getenv("DISPLAY"); if (display_text != 0) { wts->display_num = get_display_num_from_display(display_text); } if (wts->display_num <= 0) { LLOGLN(0, ("WTSVirtualChannelOpenEx: fatal error; display is 0")); free(wts); return NULL; } /* we use unix domain socket to communicate with chansrv */ if ((wts->fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { LLOGLN(0, ("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) { LLOGLN(0, ("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, 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 { LLOGLN(0, ("WTSVirtualChannelOpenEx: connect failed")); free(wts); return NULL; } } /* wait for connection to complete */ if (!can_send(wts->fd, 500)) { LLOGLN(0, ("WTSVirtualChannelOpenEx: can_send failed")); free(wts); return NULL; } chan_name_bytes = strlen(pVirtualName); bytes = 4 + 4 + 4 + chan_name_bytes + 4; LLOGLN(10, ("WTSVirtualChannelOpenEx: chan_name_bytes %d bytes %d pVirtualName %s", chan_name_bytes, bytes, pVirtualName)); connect_data = (char *) calloc(bytes, 1); if (connect_data == NULL) { LLOGLN(0, ("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; LLOGLN(10, ("WTSVirtualChannelOpenEx: calling mysend with %d bytes", bytes)); if (mysend(wts->fd, connect_data, bytes) != bytes) { LLOGLN(0, ("WTSVirtualChannelOpenEx: mysend failed")); free(wts); return NULL; } LLOGLN(10, ("WTSVirtualChannelOpenEx: sent ok")); if (!can_recv(wts->fd, 500)) { LLOGLN(0, ("WTSVirtualChannelOpenEx: can_recv failed")); free(wts); return NULL; } /* get response */ if (myrecv(wts->fd, connect_data, 4) != 4) { LLOGLN(0, ("WTSVirtualChannelOpenEx: myrecv failed")); free(wts); return NULL; } if ((connect_data[0] != 0) || (connect_data[1] != 0) || (connect_data[2] != 0) || (connect_data[3] != 0)) { LLOGLN(0, ("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)) { 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)) { 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) { LLOGLN(10, ("WTSVirtualChannelWrite: wts is NULL")); return 0; } if (!can_send(wts->fd, 0)) { return 1; /* can't write now, ok to try again */ } rv = mysend(wts->fd, Buffer, Length); LLOGLN(10, ("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)) { 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 * * @return 0 if write will block * @return 1 if write will not block ******************************************************************************/ static int can_send(int sck, int millis) { struct timeval time; fd_set wfds; int select_rv; /* setup for a select call */ FD_ZERO(&wfds); FD_SET(sck, &wfds); time.tv_sec = millis / 1000; time.tv_usec = (millis * 1000) % 1000000; /* check if it is ok to write to specified socket */ select_rv = select(sck + 1, 0, &wfds, 0, &time); return (select_rv > 0) ? 1 : 0; } /*****************************************************************************/ static int can_recv(int sck, int millis) { struct timeval time; fd_set rfds; int select_rv; FD_ZERO(&rfds); FD_SET(sck, &rfds); time.tv_sec = millis / 1000; time.tv_usec = (millis * 1000) % 1000000; select_rv = select(sck + 1, &rfds, 0, 0, &time); if (select_rv > 0) { return 1; } return 0; } /*****************************************************************************/ static int get_display_num_from_display(char *display_text) { int index; int mode; int disp_index; char disp[256]; index = 0; disp_index = 0; mode = 0; while (display_text[index] != 0) { if (display_text[index] == ':') { mode = 1; } else if (display_text[index] == '.') { mode = 2; } else if (mode == 1) { disp[disp_index] = display_text[index]; disp_index++; } index++; } disp[disp_index] = 0; return atoi(disp); } xrdp-0.9.12/xrdpapi/vrplayer.c000644 001751 001751 00000005212 13544635324 016170 0ustar00metameta000000 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) { char *data; char *data1; void *channel; int written = 0; int rv; int first_time = 1; int length; int bytes_read; 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.9.12/xrdpapi/vrplayer.mk000644 001751 001751 00000000232 13544635324 016352 0ustar00metameta000000 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.9.12/xrdpapi/simple.c000644 001751 001751 00000010454 13544635324 015621 0ustar00metameta000000 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 -L./.libs -lxrdpapi */ #if defined(HAVE_CONFIG_H) #include #endif #ifdef __WIN32__ #include #endif #include "xrdpapi.h" #include #include #include #include #include /* forward declarations */ int run_echo_test(void); int run_tsmf_test(void); int main(int argc, char **argv) { if (argc < 2) { printf("usage: simple \n"); return 1; } if (strcasecmp(argv[1], "echo") == 0) { return run_echo_test(); } else if (strcasecmp(argv[1], "tsmf") == 0) { return run_tsmf_test(); } else { printf("usage: simple \n"); return 1; } } /** * 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; int i; int bytes_written; int bytes_read; unsigned char c; unsigned char *rd_ptr; unsigned char *wr_ptr; /* fill out_buf[] with incremental values */ for (i = 0, c = 0; i < 8192; i++, c++) { out_buf[i] = 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.9.12/xrdpapi/Makefile.in000644 001751 001751 00000052022 13601646126 016222 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ 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 = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libxrdpapi_la_LIBADD = 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_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)/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) DIST_SOURCES = $(libxrdpapi_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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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_PATH=\"${socketdir}\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libxrdpapi.la libxrdpapi_la_SOURCES = \ xrdpapi.c \ xrdpapi.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 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): 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: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdpapi.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -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)/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 \ 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: xrdp-0.9.12/xrdpapi/xrdpapi.h000644 001751 001751 00000005110 13544635324 015775 0ustar00metameta000000 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.9.12/xrdpapi/Makefile.am000644 001751 001751 00000000350 13544635324 016212 0ustar00metameta000000 000000 EXTRA_DIST = \ simple.c \ vrplayer.c \ vrplayer.mk AM_CPPFLAGS = \ -DXRDP_SOCKET_PATH=\"${socketdir}\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libxrdpapi.la libxrdpapi_la_SOURCES = \ xrdpapi.c \ xrdpapi.h xrdp-0.9.12/keygen/Makefile.am000644 001751 001751 00000002027 13544635323 016027 0ustar00metameta000000 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.9.12/keygen/keygen.c000644 001751 001751 00000046032 13544635323 015425 0ustar00metameta000000 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 "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(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.9.12/keygen/Makefile.in000644 001751 001751 00000052565 13601646126 016051 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/keygen/openssl.conf000644 001751 001751 00000002074 13544635323 016327 0ustar00metameta000000 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.9.12/tests/.gitignore000644 001751 001751 00000000012 13544635323 015633 0ustar00metameta000000 000000 !Makefile xrdp-0.9.12/tests/gtcp_proxy/000755 001751 001751 00000000000 13544635323 016050 5ustar00metameta000000 000000 xrdp-0.9.12/tests/tcp_proxy/000755 001751 001751 00000000000 13544635323 015701 5ustar00metameta000000 000000 xrdp-0.9.12/tests/readme.txt000644 001751 001751 00000000052 13544635323 015645 0ustar00metameta000000 000000 this directory contains different tests xrdp-0.9.12/tests/memtest/000755 001751 001751 00000000000 13544635323 015330 5ustar00metameta000000 000000 xrdp-0.9.12/tests/memtest/memtest.c000644 001751 001751 00000002477 13544635323 017164 0ustar00metameta000000 000000 #include #include #include #include "libmem.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; 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); return 0; } xrdp-0.9.12/tests/memtest/libmem.h000644 001751 001751 00000000543 13544635323 016750 0ustar00metameta000000 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.9.12/tests/memtest/Makefile000644 001751 001751 00000000226 13544635323 016770 0ustar00metameta000000 000000 OBJS = libmem.o memtest.o #CFLAGS = -O2 -Wall CFLAGS = -g all: memtest memtest: $(OBJS) $(CC) -o memtest $(OBJS) clean: rm -f $(OBJS) librdp.a xrdp-0.9.12/tests/memtest/libmem.c000644 001751 001751 00000021223 13544635323 016741 0ustar00metameta000000 000000 #include #include #include #define ALIGN_BY 32 #define ALIGN_BY_M1 (ALIGN_BY - 1) #define ALIGN(_in) (((_in) + ALIGN_BY_M1) & (~ALIGN_BY_M1)) #define LLOG_LEVEL 1 #define LLOGLN(_log_level, _params) \ do { \ if (_log_level < LLOG_LEVEL) \ { \ printf _params ; \ printf ("\n") ; \ } \ } while (0) 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; LLOGLN(0, ("libmem_print:")); LLOGLN(0, (" used_head %p", self->used_head)); LLOGLN(0, (" used_tail %p", self->used_tail)); mi = self->used_head; if (mi != 0) { LLOGLN(0, (" used list")); while (mi != 0) { LLOGLN(0, (" ptr %p prev %p next %p addr 0x%8.8x bytes %d", mi, mi->prev, mi->next, mi->addr, mi->bytes)); mi = mi->next; } } LLOGLN(0, (" free_head %p", self->free_head)); LLOGLN(0, (" free_tail %p", self->free_tail)); mi = self->free_head; if (mi != 0) { LLOGLN(0, (" free list")); while (mi != 0) { LLOGLN(0, (" 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 { LLOGLN(0, ("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; } LLOGLN(0, ("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.9.12/tests/tcp_proxy/Makefile000644 001751 001751 00000000275 13544635323 017345 0ustar00metameta000000 000000 CFLAGS = -O2 -Wall LDFLAGS = OBJS = main.o LIBS = -ldl all: tcp_proxy tcp_proxy: $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) -o tcp_proxy $(OBJS) $(LIBS) .PHONY clean: rm -f $(OBJS) tcp_proxy xrdp-0.9.12/tests/tcp_proxy/main.c000644 001751 001751 00000037116 13544635323 017001 0ustar00metameta000000 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. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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]; #define #define typedef unsigned short tui16; /*****************************************************************************/ static void g_memset(void *ptr, int val, int size) { memset(ptr, val, size); } /*****************************************************************************/ static void g_printf(const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stdout, format, ap); va_end(ap); } /*****************************************************************************/ static void g_writeln(const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stdout, format, ap); va_end(ap); g_printf("\n"); } /*****************************************************************************/ static void g_hexdump(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; } } /*****************************************************************************/ static int g_tcp_socket(void) { int rv; int option_value; socklen_t option_len; rv = (int)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); 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; } /*****************************************************************************/ static int g_tcp_set_non_blocking(int sck) { unsigned long i; i = fcntl(sck, F_GETFL); i = i | O_NONBLOCK; fcntl(sck, F_SETFL, i); return 0; } /*****************************************************************************/ static 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)); } /*****************************************************************************/ static int g_tcp_listen(int sck) { return listen(sck, 2); } /*****************************************************************************/ static int g_tcp_select(int sck1, int sck2) { fd_set rfds; struct timeval time; int max = 0; int rv = 0; g_memset(&rfds, 0, sizeof(fd_set)); g_memset(&time, 0, sizeof(struct timeval)); time.tv_sec = 0; time.tv_usec = 0; FD_ZERO(&rfds); if (sck1 > 0) { FD_SET(((unsigned int)sck1), &rfds); } if (sck2 > 0) { FD_SET(((unsigned int)sck2), &rfds); } max = sck1; if (sck2 > max) { max = sck2; } rv = select(max + 1, &rfds, 0, 0, &time); if (rv > 0) { rv = 0; if (FD_ISSET(((unsigned int)sck1), &rfds)) { rv = rv | 1; } if (FD_ISSET(((unsigned int)sck2), &rfds)) { rv = rv | 2; } } else { rv = 0; } return rv; } /*****************************************************************************/ static int g_tcp_recv(int sck, void *ptr, int len, int flags) { return recv(sck, ptr, len, flags); } /*****************************************************************************/ static void g_tcp_close(int sck) { if (sck == 0) { return; } close(sck); } /*****************************************************************************/ static int g_tcp_send(int sck, const void *ptr, int len, int flags) { return send(sck, ptr, len, flags); } /*****************************************************************************/ void g_sleep(int msecs) { usleep(msecs * 1000); } /*****************************************************************************/ static int g_tcp_last_error_would_block(int sck) { return (errno == EWOULDBLOCK) || (errno == EAGAIN) || (errno == EINPROGRESS); } /*****************************************************************************/ static int g_tcp_accept(int sck) { int ret ; struct sockaddr_in s; unsigned int i; i = sizeof(struct sockaddr_in); memset(&s, 0, i); ret = accept(sck, (struct sockaddr *)&s, &i); return ret ; } /*****************************************************************************/ static int g_tcp_connect(int sck, const char* address, const char* port) { struct sockaddr_in s; struct hostent* h; 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))); } } } } } return connect(sck, (struct sockaddr*)&s, sizeof(struct sockaddr_in)); } /*****************************************************************************/ 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 void g_init(const char *app_name) { setlocale(LC_CTYPE, ""); } /*****************************************************************************/ static void g_deinit(void) { } /*****************************************************************************/ static int g_tcp_can_send(int sck, int millis) { fd_set wfds; struct timeval time; int rv; time.tv_sec = millis / 1000; time.tv_usec = (millis * 1000) % 1000000; FD_ZERO(&wfds); if (sck > 0) { FD_SET(((unsigned int)sck), &wfds); rv = select(sck + 1, 0, &wfds, 0, &time); if (rv > 0) { return g_tcp_socket_ok(sck); } } return 0; } /*****************************************************************************/ static void g_signal_user_interrupt(void (*func)(int)) { signal(SIGINT, func); } /*****************************************************************************/ static void g_signal_terminate(void (*func)(int)) { signal(SIGTERM, func); } /*****************************************************************************/ static void g_signal_usr1(void (*func)(int)) { signal(SIGUSR1, func); } /*****************************************************************************/ static int g_strcasecmp(const char *c1, const char *c2) { return strcasecmp(c1, c2); } /*****************************************************************************/ 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) { g_writeln("bind failed"); } /* listen for an incoming connection */ if (error == 0) { error = g_tcp_listen(lis_sck); if (error == 0) { g_writeln("listening for connection"); } } /* accept an incoming connection */ if (error == 0) { while ((!g_terminated) && (error == 0)) { acc_sck = g_tcp_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) { g_writeln("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_terminated) && (i < 100)) { g_sleep(100); i++; } if (i > 99) { g_writeln("timeout connecting"); error = 1; } if (g_terminated) { error = 1; } } if ((error != 0) && (!g_terminated)) { g_writeln("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) { g_writeln("from remove, the socket from connect"); g_hexdump(g_buf, count); } #if 0 g_writeln("local_io_count: %d\tremote_io_count: %d", g_loc_io_count, g_rem_io_count); #endif 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)) { g_tcp_can_send(acc_sck, 1000); } 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) { g_writeln("from accepted, the socket from accept"); g_hexdump(g_buf, count); } #if 0 g_writeln("local_io_count: %d\tremote_io_count: %d", g_loc_io_count, g_rem_io_count); #endif 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)) { g_tcp_can_send(con_sck, 1000); } else if (i < 1) { error = 1; } else { sent += i; } } } } } g_tcp_close(lis_sck); g_tcp_close(con_sck); g_tcp_close(acc_sck); g_writeln("acc_to_con %d", acc_to_con); g_writeln("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) { g_writeln("shutting down"); g_terminated = 1; } void clear_counters(int sig) { g_writeln("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; 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 */ 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); } } g_deinit(); return 0; } xrdp-0.9.12/tests/gtcp_proxy/Makefile000644 001751 001751 00000000715 13544635323 017513 0ustar00metameta000000 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.9.12/tests/gtcp_proxy/hexdump.c000644 001751 001751 00000007022 13544635323 017667 0ustar00metameta000000 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. */ #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.9.12/tests/gtcp_proxy/README.txt000644 001751 001751 00000000147 13544635323 017550 0ustar00metameta000000 000000 gtcp-proxy is a 'man in the middle' program to monitor data flowing between two network connections. xrdp-0.9.12/tests/gtcp_proxy/gtcp.c000644 001751 001751 00000020725 13544635323 017157 0ustar00metameta000000 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. */ #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) { int ret ; char ipAddr[256] ; 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) { fd_set wfds; struct timeval time; int rv; time.tv_sec = millis / 1000; time.tv_usec = (millis * 1000) % 1000000; FD_ZERO(&wfds); if (skt > 0) { FD_SET(((unsigned int) skt), &wfds); rv = select(skt + 1, 0, &wfds, 0, &time); if (rv > 0) { return tcp_socket_ok(skt); } } return 0; } /** * 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) { fd_set rfds; struct timeval time; int max = 0; int rv = 0; memset(&rfds, 0, sizeof(fd_set)); memset(&time, 0, sizeof(struct timeval)); time.tv_sec = 0; time.tv_usec = 0; FD_ZERO(&rfds); if (sck1 > 0) FD_SET(((unsigned int) sck1), &rfds); if (sck2 > 0) FD_SET(((unsigned int) sck2), &rfds); max = sck1; if (sck2 > max) max = sck2; rv = select(max + 1, &rfds, 0, 0, &time); if (rv > 0) { rv = 0; if (FD_ISSET(((unsigned int) sck1), &rfds)) rv = rv | 1; if (FD_ISSET(((unsigned int)sck2), &rfds)) rv = rv | 2; } else { rv = 0; } 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.9.12/tests/gtcp_proxy/gtcp-proxy.c000644 001751 001751 00000046224 13544635323 020340 0ustar00metameta000000 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. */ #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.9.12/tests/gtcp_proxy/gtcp.h000644 001751 001751 00000002621 13544635323 017157 0ustar00metameta000000 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.9.12/m4/ltsugar.m4000644 001751 001751 00000010440 13601646122 014743 0ustar00metameta000000 000000 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 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.9.12/m4/ax_append_compile_flags.m4000644 001751 001751 00000005654 13544635323 020127 0ustar00metameta000000 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.9.12/m4/ax_cflags_warn_all.m4000644 001751 001751 00000011701 13544635323 017100 0ustar00metameta000000 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.9.12/m4/pkg.m4000644 001751 001751 00000024011 13544635323 014051 0ustar00metameta000000 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.9.12/m4/ax_check_compile_flag.m4000644 001751 001751 00000006402 13544635323 017542 0ustar00metameta000000 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.9.12/m4/ax_require_defined.m4000644 001751 001751 00000002301 13544635323 017110 0ustar00metameta000000 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.9.12/m4/.gitignore000644 001751 001751 00000000022 13544635323 015012 0ustar00metameta000000 000000 libtool.m4 lt*.m4 xrdp-0.9.12/m4/ltoptions.m4000644 001751 001751 00000034262 13601646122 015325 0ustar00metameta000000 000000 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 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.9.12/m4/ax_type_socklen_t.m4000644 001751 001751 00000004612 13544635323 017007 0ustar00metameta000000 000000 # =========================================================================== # http://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 6 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_TRY_COMPILE( [#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.9.12/m4/ax_append_flag.m4000644 001751 001751 00000005331 13544635323 016224 0ustar00metameta000000 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.9.12/m4/ltversion.m4000644 001751 001751 00000001273 13601646122 015313 0ustar00metameta000000 000000 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 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 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) xrdp-0.9.12/m4/lt~obsolete.m4000644 001751 001751 00000013774 13601646122 015651 0ustar00metameta000000 000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 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.9.12/m4/ax_gcc_func_attribute.m4000644 001751 001751 00000017073 13544635323 017624 0ustar00metameta000000 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.9.12/m4/libtool.m4000644 001751 001751 00001125073 13601646122 014740 0ustar00metameta000000 000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 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 58 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_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, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_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 cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru 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*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test 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], [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 `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out 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 `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; 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 `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file 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 `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file 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 `/usr/bin/file 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} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [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* | 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 -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_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*) # Native MSVC 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 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*) # 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='/usr/bin/file -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*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-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=/usr/bin/file 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++, # 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*) # 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 == "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*) _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++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) 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 ;; 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 == "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++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _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 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*) _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 ;; 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*) # Native MSVC # 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 ;; 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*) # 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_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.9.12/instfiles/km-00000414.ini000644 001751 001751 00000021225 13544635323 016510 0ustar00metameta000000 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.9.12/instfiles/Makefile.in000644 001751 001751 00000061627 13601646125 016565 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 # # 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @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: xrdp-0.9.12/instfiles/km-00000813.ini000644 001751 001751 00000021060 13544635323 016510 0ustar00metameta000000 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.9.12/instfiles/xrdp-sesman.service.in000644 001751 001751 00000000703 13544635323 020740 0ustar00metameta000000 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=forking PIDFile=@localstatedir@/run/xrdp-sesman.pid EnvironmentFile=-@sysconfdir@/sysconfig/xrdp EnvironmentFile=-@sysconfdir@/default/xrdp ExecStart=@sbindir@/xrdp-sesman $SESMAN_OPTIONS ExecStop=@sbindir@/xrdp-sesman $SESMAN_OPTIONS --kill [Install] WantedBy=multi-user.target xrdp-0.9.12/instfiles/keymap-names.txt000644 001751 001751 00000007147 13544635323 017651 0ustar00metameta000000 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.9.12/instfiles/rc.d/000755 001751 001751 00000000000 13601646134 015332 5ustar00metameta000000 000000 xrdp-0.9.12/instfiles/Makefile.am000644 001751 001751 00000003525 13601643631 016544 0ustar00metameta000000 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 # # 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.9.12/instfiles/km-00000412.ini000644 001751 001751 00000035221 13544635323 016507 0ustar00metameta000000 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.9.12/instfiles/km-00000415.ini000644 001751 001751 00000025242 13544635323 016514 0ustar00metameta000000 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.9.12/instfiles/default/000755 001751 001751 00000000000 13601646134 016130 5ustar00metameta000000 000000 xrdp-0.9.12/instfiles/pulse/000755 001751 001751 00000000000 13601646134 015634 5ustar00metameta000000 000000 xrdp-0.9.12/instfiles/km-0000040a.ini000644 001751 001751 00000021024 13544635323 016561 0ustar00metameta000000 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.9.12/instfiles/km-0000080a.ini000644 001751 001751 00000034370 13544635323 016575 0ustar00metameta000000 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.9.12/instfiles/km-00000407.ini000644 001751 001751 00000025277 13544635323 016525 0ustar00metameta000000 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.9.12/instfiles/km-00000809.ini000644 001751 001751 00000034400 13544635323 016517 0ustar00metameta000000 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.9.12/instfiles/km-00000409.ini000644 001751 001751 00000024662 13544635323 016524 0ustar00metameta000000 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.9.12/instfiles/km-00000807.ini000644 001751 001751 00000020762 13544635323 016523 0ustar00metameta000000 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.9.12/instfiles/km-0000040b.ini000644 001751 001751 00000025177 13544635323 016577 0ustar00metameta000000 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.9.12/instfiles/km-0000100c.ini000644 001751 001751 00000020762 13544635323 016570 0ustar00metameta000000 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.9.12/instfiles/xrdp.service.in000644 001751 001751 00000000636 13544635323 017461 0ustar00metameta000000 000000 [Unit] Description=xrdp daemon Documentation=man:xrdp(8) man:xrdp.ini(5) Requires=xrdp-sesman.service After=network.target xrdp-sesman.service [Service] Type=forking PIDFile=@localstatedir@/run/xrdp.pid EnvironmentFile=-@sysconfdir@/sysconfig/xrdp EnvironmentFile=-@sysconfdir@/default/xrdp ExecStart=@sbindir@/xrdp $XRDP_OPTIONS ExecStop=@sbindir@/xrdp $XRDP_OPTIONS --kill [Install] WantedBy=multi-user.target xrdp-0.9.12/instfiles/km-0000041d.ini000644 001751 001751 00000025177 13544635323 016602 0ustar00metameta000000 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.9.12/instfiles/init.d/000755 001751 001751 00000000000 13601646134 015671 5ustar00metameta000000 000000 xrdp-0.9.12/instfiles/km-00000816.ini000644 001751 001751 00000025174 13544635323 016525 0ustar00metameta000000 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.9.12/instfiles/km-00000416.ini000644 001751 001751 00000021720 13544635323 016512 0ustar00metameta000000 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.9.12/instfiles/km-00000411.ini000644 001751 001751 00000034026 13544635323 016510 0ustar00metameta000000 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.9.12/instfiles/km-0000080c.ini000644 001751 001751 00000021060 13544635323 016567 0ustar00metameta000000 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.9.12/instfiles/km-0000040c.ini000644 001751 001751 00000021050 13544635323 016562 0ustar00metameta000000 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.9.12/instfiles/km-00000406.ini000644 001751 001751 00000021057 13544635323 016514 0ustar00metameta000000 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.9.12/instfiles/km-00000410.ini000644 001751 001751 00000025157 13544635323 016514 0ustar00metameta000000 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.9.12/instfiles/km-00000419.ini000644 001751 001751 00000026070 13544635323 016520 0ustar00metameta000000 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.9.12/instfiles/km-00010409.ini000644 001751 001751 00000033246 13544635323 016523 0ustar00metameta000000 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.9.12/instfiles/pam.d/000755 001751 001751 00000000000 13601646134 015503 5ustar00metameta000000 000000 xrdp-0.9.12/instfiles/pam.d/mkpamrules000755 001751 001751 00000001755 13601643631 017620 0ustar00metameta000000 000000 #!/bin/sh # Find suitable PAM config file rules="$1" srcdir="$2" outfile="$3" service="xrdp-sesman" pamdir="/etc/pam.d" pamdir_suse="/usr/etc/pam.d" guess_rules () { if test -s "$pamdir/password-auth"; then rules="redhat" return fi if test -s "$pamdir_suse/common-account"; then rules="suse" return fi if test -s "$pamdir/common-account"; then if grep "^@include" "$pamdir/passwd" >/dev/null 2>&1; then rules="debian" else rules="suse" fi return fi if test ! -f "$pamdir/system-auth" -a -s "$pamdir/system"; then rules="freebsd" return fi if test -s "$pamdir/authorization"; then rules="macos" return fi if test -s "$pamdir/system-remote-login"; then rules="arch" return fi rules="unix" return } if test "$rules" = "auto"; then guess_rules fi if test -s "$srcdir/$service.$rules"; then ln -nsf "$srcdir/$service.$rules" "$outfile" else echo "Cannot find $srcdir/$service.$rules" exit 1 fi xrdp-0.9.12/instfiles/pam.d/xrdp-sesman.unix000644 001751 001751 00000000232 13544635323 020652 0ustar00metameta000000 000000 #%PAM-1.0 auth include system-auth account include system-auth password include system-auth session include system-auth xrdp-0.9.12/instfiles/pam.d/xrdp-sesman.redhat000644 001751 001751 00000000242 13544635323 021137 0ustar00metameta000000 000000 #%PAM-1.0 auth include password-auth account include password-auth session include password-auth password include password-auth xrdp-0.9.12/instfiles/pam.d/xrdp-sesman.macos000644 001751 001751 00000001100 13544635323 020764 0ustar00metameta000000 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.9.12/instfiles/pam.d/xrdp-sesman.suse000644 001751 001751 00000000244 13544635323 020651 0ustar00metameta000000 000000 #%PAM-1.0 auth include common-auth account include common-account session include common-session password include common-password xrdp-0.9.12/instfiles/pam.d/Makefile.am000644 001751 001751 00000000772 13544635323 017551 0ustar00metameta000000 000000 PAM_FILES = \ xrdp-sesman.debian \ xrdp-sesman.redhat \ xrdp-sesman.suse \ xrdp-sesman.freebsd \ xrdp-sesman.macos \ xrdp-sesman.unix \ xrdp-sesman.arch 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 = $(sysconfdir)/pam.d pamd_DATA = \ $(PAMFILE) xrdp-sesman: mkpamrules $(srcdir)/mkpamrules $(PAM_RULES) $(srcdir) $@ xrdp-0.9.12/instfiles/pam.d/xrdp-sesman.freebsd000644 001751 001751 00000000206 13544635323 021302 0ustar00metameta000000 000000 #%PAM-1.0 auth include system account include system password include system session include system xrdp-0.9.12/instfiles/pam.d/xrdp-sesman.debian000644 001751 001751 00000000150 13544635323 021110 0ustar00metameta000000 000000 #%PAM-1.0 @include common-auth @include common-account @include common-session @include common-password xrdp-0.9.12/instfiles/pam.d/xrdp-sesman.arch000644 001751 001751 00000000272 13544635323 020610 0ustar00metameta000000 000000 #%PAM-1.0 auth include system-remote-login account include system-remote-login password include system-remote-login session include system-remote-login xrdp-0.9.12/instfiles/pam.d/Makefile.in000644 001751 001751 00000037151 13601646125 017557 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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.debian \ xrdp-sesman.redhat \ xrdp-sesman.suse \ xrdp-sesman.freebsd \ xrdp-sesman.macos \ xrdp-sesman.unix \ xrdp-sesman.arch 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 = $(sysconfdir)/pam.d 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/instfiles/init.d/xrdp000644 001751 001751 00000012061 13544635323 016575 0ustar00metameta000000 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 readables 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 pidffile 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.9.12/instfiles/init.d/Makefile.am000644 001751 001751 00000000106 13544635323 017726 0ustar00metameta000000 000000 startscriptdir = $(sysconfdir)/init.d dist_startscript_SCRIPTS = xrdp xrdp-0.9.12/instfiles/init.d/Makefile.in000644 001751 001751 00000037664 13601646125 017756 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/instfiles/pulse/default.pa000644 001751 001751 00000000404 13544635323 017604 0ustar00metameta000000 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.9.12/instfiles/pulse/Makefile.in000644 001751 001751 00000036156 13601646125 017714 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/instfiles/pulse/Makefile.am000644 001751 001751 00000000101 13544635323 017664 0ustar00metameta000000 000000 pulsedir = $(sysconfdir)/xrdp/pulse dist_pulse_DATA = default.pa xrdp-0.9.12/instfiles/default/xrdp000644 001751 001751 00000000254 13544635323 017035 0ustar00metameta000000 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.9.12/instfiles/default/Makefile.am000644 001751 001751 00000000104 13544635323 020163 0ustar00metameta000000 000000 startscriptdir = $(sysconfdir)/default dist_startscript_DATA = xrdp xrdp-0.9.12/instfiles/default/Makefile.in000644 001751 001751 00000036357 13601646125 020213 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/instfiles/rc.d/xrdp-sesman000644 001751 001751 00000003177 13544635323 017532 0ustar00metameta000000 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.9.12/instfiles/rc.d/xrdp000644 001751 001751 00000005000 13544635323 016231 0ustar00metameta000000 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.9.12/instfiles/rc.d/Makefile.am000644 001751 001751 00000000120 13544635323 017363 0ustar00metameta000000 000000 startscriptdir = $(sysconfdir)/rc.d dist_startscript_SCRIPTS = xrdp xrdp-sesman xrdp-0.9.12/instfiles/rc.d/Makefile.in000644 001751 001751 00000037670 13601646125 017414 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/tcutils/README.txt000644 001751 001751 00000001216 13544635323 015675 0ustar00metameta000000 000000 A QT based utility program for thin clients using xrdp and NeutrinoRDP This program sends commands to NeutrinoRDP to do something useful on the client end (such as unmounting a USB drive, or powering down the client) Required packages to build tcutils: ----------------------------------- libqt4-gui qt4-dev-tools to build tcutils: ----------------- qmake make To run tcutils: --------------- include xrdpapi/.libs in your LD_LIBRARY_PATH Example: -------- export LD_LIBRARY_PATH=../xrdpapi/.libs run tcutils inside the xfreerdp session this is how we run xfreerdp: ---------------------------- ./xfreerdp --sec rdp --plugin tcutils 192.168.2.149 xrdp-0.9.12/tcutils/mainwindow.cpp000644 001751 001751 00000013601 13544635323 017060 0ustar00metameta000000 000000 #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); wtsChannel = NULL; okToQuit = false; savedGeometry = this->geometry(); /* setup tab to unmount drives */ ui->tabWidget->setTabText(0, "Unmount drives"); connect(ui->btnRefresh, SIGNAL(clicked()), this, SLOT(onBtnRefreshClicked())); connect(ui->btnUnmount, SIGNAL(clicked()), this, SLOT(onBtnUnmountClicked())); ui->tabWidget->setTabText(1, ""); if (initWtsChannel()) { okToQuit = true; QTimer::singleShot(10, qApp, SLOT(quit())); return; } setupSystemTray(); /* set up status bar to display messages */ statusBar = new QStatusBar; this->setStatusBar(statusBar); setStatusMsg("Connected to client"); } MainWindow::~MainWindow() { delete ui; } void MainWindow::setupSystemTray() { trayMenu = new QMenu(this); trayMenu->addAction("Launch Thinclient Utils", this, SLOT(onActionLaunch())); trayMenu->addSeparator(); trayMenu->addAction("Quit", this, SLOT(onActionQuit())); trayIcon = new QSystemTrayIcon; trayIcon->setContextMenu(trayMenu); trayIcon->setIcon(QIcon(":/images/resources/images/tools.gif")); trayIcon->show(); trayIcon->showMessage("TCutils", "Click on the tcutils icon to launch tcutils", QSystemTrayIcon::Information, 3000); connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(onSystemTrayClicked(QSystemTrayIcon::ActivationReason))); } /** * *****************************************************************************/ int MainWindow::initWtsChannel() { /* init the channel just once */ if (wtsChannel) return 0; /* open a WTS channel and connect to remote client */ wtsChannel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "tcutils", 0); if (wtsChannel == NULL) { QMessageBox::information(this, "Open virtual channel", "Error " "connecting to remote client. This program " "can only be used when connected via " "NeutrinoRDP.\n\nClick ok to close this " "application"); return -1; } return 0; } /** * *****************************************************************************/ int MainWindow::deinitWtsChannel() { if (!wtsChannel) return -1; WTSVirtualChannelClose(wtsChannel); return 0; } /** * Display a msg on the status bar * * @param msg message to display in status bar *****************************************************************************/ void MainWindow::setStatusMsg(QString msg) { statusBar->showMessage(msg, 30000); } /** * *****************************************************************************/ void MainWindow::closeEvent(QCloseEvent *event) { if (!okToQuit) { savedGeometry = this->geometry(); this->hide(); event->ignore(); return; } if (wtsChannel) deinitWtsChannel(); event->accept(); } /****************************************************************************** ** ** ** slots go here ** ** ** ******************************************************************************/ #if 1 void MainWindow::onBtnRefreshClicked() { int i; /* clear drive list */ if (itemList.count()) { for (i = 0; i < itemList.count(); i++) ui->listWidget->removeItemWidget(itemList.at(i)); itemList.clear(); } ui->listWidget->clear(); if (Utils::getMountList(wtsChannel, &itemList)) { QMessageBox::information(this, "Get device list", "\nError getting " "device list from client"); return; } if (itemList.count() == 0) { QMessageBox::information(this, "Get device list", "\nNo devices found!"); return; } /* add mount point to list widget */ for (i = 0; i < itemList.count(); i++) ui->listWidget->insertItem(i, itemList.at(i)); } #else void MainWindow::onBtnRefreshClicked() { QListWidgetItem *item; int i; int j; /* clear drive list */ if (itemList.count()) { for (i = 0; i < itemList.count(); i++) ui->listWidget->removeItemWidget(itemList.at(i)); itemList.clear(); } ui->listWidget->clear(); QDir dir(QDir::homePath() + "/xrdp_client"); QStringList sl = dir.entryList(); for (i = 0, j = 0; i < sl.count(); i++) { /* skip files starting with . */ if (sl.at(i).startsWith(".")) continue; /* add mount point to list widget */ item = new QListWidgetItem; item->setText(sl.at(i)); ui->listWidget->insertItem(j++, item); itemList.append(item); } } #endif void MainWindow::onBtnUnmountClicked() { QListWidgetItem *item = ui->listWidget->currentItem(); if (!item) { QMessageBox::information(this, "Unmount device", "\nNo device selected. " "You must select a device to unmount"); return; } if (Utils::unmountDevice(wtsChannel, item->text(), statusBar) == 0) { delete ui->listWidget->takeItem(itemList.indexOf(item)); itemList.removeOne(item); } } void MainWindow::onActionQuit() { okToQuit = true; this->close(); } void MainWindow::onActionLaunch() { this->show(); this->setGeometry(savedGeometry); } void MainWindow::onSystemTrayClicked(QSystemTrayIcon::ActivationReason) { trayMenu->popup(QCursor::pos()); } xrdp-0.9.12/tcutils/mainwindow.h000644 001751 001751 00000002210 13544635323 016517 0ustar00metameta000000 000000 #ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include #include #include #include #include #include #include #include //#include #include "utils.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private: Ui::MainWindow *ui; void *wtsChannel; QSystemTrayIcon *trayIcon; QMenu *trayMenu; bool okToQuit; QRect savedGeometry; QStatusBar *statusBar; QList itemList; void setupSystemTray(); int initWtsChannel(); int deinitWtsChannel(); void setStatusMsg(QString msg); void closeEvent(QCloseEvent * event); private slots: void onBtnRefreshClicked(); void onBtnUnmountClicked(); void onActionQuit(); void onActionLaunch(); void onSystemTrayClicked(QSystemTrayIcon::ActivationReason); }; #endif // MAINWINDOW_H xrdp-0.9.12/tcutils/resources.qrc000644 001751 001751 00000000157 13544635323 016723 0ustar00metameta000000 000000 resources/images/tools.gif xrdp-0.9.12/tcutils/utils.cpp000644 001751 001751 00000012521 13544635323 016044 0ustar00metameta000000 000000 #include "utils.h" Utils::Utils() { } int Utils::getMountList(void *wtsChannel, QList *itemList) { QListWidgetItem *item; STREAM s; quint32 bytesToSend; quint32 bytesWritten; quint32 bytesRead; quint32 cmdLen; quint32 cmd; int rv; int i; int nentries; char buf[2048]; if (!wtsChannel) return -1; qstream_new(s, 1024 * 8); /* * command format: * 4 bytes cmd_len length of this command * 1 byte cmd TCU_CMD_GET_MOUNT_LIST */ /* setup command */ qstream_wr_u32(&s, 1); qstream_wr_u8(&s, TCU_CMD_GET_MOUNT_LIST); bytesToSend = 5; /* send command */ rv = WTSVirtualChannelWrite(wtsChannel, s.data, bytesToSend, &bytesWritten); if (rv == 0) { QMessageBox::information(NULL, "Get device list", "\nError sending " "command to client"); return -1; } qstream_set_pos(&s, 0); /* reuse stream */ /* get response */ /* * response format * 4 bytes cmd_len length of this command * 4 bytes cmd TCU_CMD_GET_MOUNT_LIST * 1 byte nentries number of entries in this pkt * n bytes entry_list nentries null terminated strings */ rv = WTSVirtualChannelRead(wtsChannel, 1000 * 5, s.data, 1024 * 8, &bytesRead); if (rv == 0 || bytesRead == 0) goto error; /* did we get the entire cmd? */ qstream_rd_u32(&s, cmdLen); if (cmdLen != bytesRead - 4) goto error; /* did we get the right response? */ qstream_rd_u32(&s, cmd); if (cmd != TCU_CMD_GET_MOUNT_LIST) goto error; qstream_rd_u8(&s, nentries); if (nentries == 0) goto done; for (i = 0; i < nentries; i++) { strcpy(buf, s.pos); qstream_inc_pos(&s, strlen(buf) + 1); item = new QListWidgetItem; item->setText(QString(buf)); itemList->append(item); } done: qstream_free(&s); return 0; error: qstream_free(&s); return -1; } int Utils::unmountDevice(void *wtsChannel, QString device, QStatusBar *statusBar) { STREAM s; quint32 bytesRead; quint32 cmdLen; quint32 cmd; quint32 bytesWritten; int bytesToSend; int rv; int seconds = 0; char status; char* buf; if (!wtsChannel) return -1; qstream_new(s, 1024); buf = device.toAscii().data(); /* * command format: * 4 bytes cmd_len length of this command * 4 bytes cmd TCU_CMD_UNMOUNT_DEVICE * n bytes device null terminated device name */ /* setup command */ bytesToSend = 4 + 4 + device.count() + 1; qstream_wr_u32(&s, bytesToSend - 4); qstream_wr_u32(&s, TCU_CMD_UNMOUNT_DEVICE); strcpy(s.pos, buf); /* send command */ rv = WTSVirtualChannelWrite(wtsChannel, s.data, bytesToSend, &bytesWritten); if (rv == 0) { QMessageBox::information(NULL, "Unmount device", "\nError sending " "command to client"); return -1; } qstream_set_pos(&s, 0); /* reuse stream */ /* get response */ /* * command format * 4 bytes cmd_len number of bytes in this pkt * 4 bytes cmd TCU_CMD_UNMOUNT_DEVICE * 1 byte status operation status code */ while (1) { rv = WTSVirtualChannelRead(wtsChannel, 1000 * 1, s.data, 1024, &bytesRead); if (rv == 0) goto error; if (bytesRead) break; statusBar->showMessage("Waiting for client to unmount device: " + QString::number(++seconds) + " seconds", 30000); } statusBar->showMessage(""); /* did we get the entire pkt? */ qstream_rd_u32(&s, cmdLen); if (cmdLen != bytesRead - 4) goto error; /* did we get the right response? */ qstream_rd_u32(&s, cmd); if (cmd != TCU_CMD_UNMOUNT_DEVICE) goto error; /* get status */ qstream_rd_u8(&s, status); switch(status) { case UMOUNT_SUCCESS: goto done; break; case UMOUNT_BUSY: QMessageBox::information(NULL, "Unmount error", "\nCannot unmount device " "because it is in use"); break; case UMOUNT_NOT_MOUNTED: QMessageBox::information(NULL, "Unmount error", "\nCannot unmount device " "because it is not mounted"); break; case UMOUNT_OP_NOT_PERMITTED: QMessageBox::information(NULL, "Unmount error", "\nOperation not " "permitted. The device may be in use"); break; case UMOUNT_PERMISSION_DENIED: QMessageBox::information(NULL, "Unmount error", "\nYou don't have " "permission to unmount this device"); break; case UMOUNT_UNKNOWN: QMessageBox::information(NULL, "Unmount error", "Cannot unmount " "device, an unknown error has occurred. The " "drive may be in use or you do not have " "permission to unmount it"); break; } goto error; done: qstream_free(&s); return 0; error: qstream_free(&s); return -1; } xrdp-0.9.12/tcutils/main.cpp000644 001751 001751 00000000266 13544635323 015633 0ustar00metameta000000 000000 #include #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } xrdp-0.9.12/tcutils/resources/000755 001751 001751 00000000000 13544635323 016211 5ustar00metameta000000 000000 xrdp-0.9.12/tcutils/utils.h000644 001751 001751 00000012262 13544635323 015513 0ustar00metameta000000 000000 #ifndef UTILS_H #define UTILS_H #include #include #include #include #include /* * stream definition and macros to access them; * all definitions default to little endian */ typedef struct stream { char* data; /* holds stream data */ char* pos; /* current read/write position */ int size; /* number of bytes in data */ } STREAM; #define qstream_new(_s, _size) \ do \ { \ (_s).data = (char *) malloc(_size); \ (_s).pos = (_s).data; \ (_s).size = (_size); \ } \ while (0) #define qstream_new_zero(_s, _size) \ do \ { \ (_s).data = (char *) calloc((_size), 1); \ (_s).pos = (_s).data; \ (_s).size = (_size); \ } \ while (0) #define qstream_free(_s) \ do \ { \ if ((_s)->data) \ free((_s)->data); \ } \ while (0) #define qstream_set_pos(_s, _p) \ do \ { \ (_s)->pos = (_s)->data + (_p); \ } \ while (0) #define qstream_inc_pos(_s, _v) \ do \ { \ (_s)->pos += (_v); \ } \ while (0) #define qstream_rd_u8(_s, _v) \ do \ { \ (_v) = *((unsigned char *) ((_s)->pos)); \ (_s)->pos++; \ } \ while (0) #define qstream_rd_u16(_s, _v) \ do \ { \ (_v) = (unsigned short) \ ( \ (*((unsigned char *) ((_s)->pos + 0)) << 0) | \ (*((unsigned char *) ((_s)->pos + 1)) << 8) \ ); \ (_s)->pos += 2; \ } while (0) #define qstream_rd_u32(_s, _v) \ do \ { \ (_v) = (unsigned int) \ ( \ (*((unsigned char *) ((_s)->pos + 0)) << 0) | \ (*((unsigned char *) ((_s)->pos + 1)) << 8) | \ (*((unsigned char *) ((_s)->pos + 2)) << 16) | \ (*((unsigned char *) ((_s)->pos + 3)) << 24) \ ); \ (_s)->pos += 4; \ } while (0) #define qstream_wr_u8(_s, _v) \ do \ { \ *((_s)->pos) = (unsigned char) (_v); \ (_s)->pos++; \ } while (0) #define qstream_wr_u16(_s, _v) \ do \ { \ *((_s)->pos) = (unsigned char) ((_v) >> 0); \ (_s)->pos++; \ *((_s)->pos) = (unsigned char) ((_v) >> 8); \ (_s)->pos++; \ } while (0) #define qstream_wr_u32(_s, _v) \ do \ { \ *((_s)->pos) = (unsigned char) ((_v) >> 0); \ (_s)->pos++; \ *((_s)->pos) = (unsigned char) ((_v) >> 8); \ (_s)->pos++; \ *((_s)->pos) = (unsigned char) ((_v) >> 16); \ (_s)->pos++; \ *((_s)->pos) = (unsigned char) ((_v) >> 24); \ (_s)->pos++; \ } while (0) /* list of commands we support; this list should match the one in */ /* NeutrinoRDP channels/tcutils/tcutils_main.h */ enum TCU_COMMANDS { TCU_CMD_GET_MOUNT_LIST = 1, TCU_CMD_UNMOUNT_DEVICE }; /* umount error codes */ enum TCU_UMOUNT_ERROR { UMOUNT_SUCCESS = 0, UMOUNT_BUSY, UMOUNT_NOT_MOUNTED, UMOUNT_OP_NOT_PERMITTED, UMOUNT_PERMISSION_DENIED, UMOUNT_UNKNOWN }; class Utils { public: Utils(); static int getMountList(void *wtsChannel, QList *itemList); static int unmountDevice(void *wtsChannel, QString device, QStatusBar *statusBar); }; #endif // UTILS_H xrdp-0.9.12/tcutils/mainwindow.ui000644 001751 001751 00000004551 13544635323 016717 0ustar00metameta000000 000000 MainWindow 0 0 541 355 TC Utils 0 0 511 291 0 Tab 1 10 10 321 221 350 60 141 27 Unmount device 350 10 141 27 Get device list Tab 2 0 0 541 25 TopToolBarArea false xrdp-0.9.12/tcutils/tcutils.pro.user000644 001751 001751 00000065527 13544635323 017404 0ustar00metameta000000 000000 ProjectExplorer.Project.ActiveTarget 0 ProjectExplorer.Project.EditorSettings true false Cpp CppGlobal QmlJS QmlJSGlobal 2 System true 4 true 1 true 2 true 0 8 true 1 true true true true ProjectExplorer.Project.PluginSettings ProjectExplorer.Project.Target.0 Desktop Desktop Qt4ProjectManager.Target.DesktopTarget 0 0 0 ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit./usr/bin/gdb qmake QtProjectManager.QMakeBuildStep false true false Make Qt4ProjectManager.MakeStep false 2 Build ProjectExplorer.BuildSteps.Build Make Qt4ProjectManager.MakeStep true clean 1 Clean ProjectExplorer.BuildSteps.Clean 2 false Qt 4.8.1 in PATH (System) Release Qt4ProjectManager.Qt4BuildConfiguration 0 /home/lk/projects/jtech/nlabs_xrdp_tcutils/tcutils-build-desktop-Qt_4_8_1_in_PATH__System__Release 1 true ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit./usr/bin/gdb qmake QtProjectManager.QMakeBuildStep false true false Make Qt4ProjectManager.MakeStep false 2 Build ProjectExplorer.BuildSteps.Build Make Qt4ProjectManager.MakeStep true clean 1 Clean ProjectExplorer.BuildSteps.Clean 2 false Qt 4.8.1 in PATH (System) Debug Qt4ProjectManager.Qt4BuildConfiguration 2 /home/lk/projects/jtech/nlabs_xrdp_tcutils/tcutils-build-desktop-Qt_4_8_1_in_PATH__System__Debug 1 true ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit./usr/bin/gdb qmake QtProjectManager.QMakeBuildStep false true false Make Qt4ProjectManager.MakeStep false 2 Build ProjectExplorer.BuildSteps.Build Make Qt4ProjectManager.MakeStep true clean 1 Clean ProjectExplorer.BuildSteps.Clean 2 false Qt 4.8.1 (System) Release Qt4ProjectManager.Qt4BuildConfiguration 0 /home/lk/projects/jtech/nlabs_xrdp_tcutils/tcutils-build-desktop-Qt_4_8_1__System__Release 2 true ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit./usr/bin/gdb qmake QtProjectManager.QMakeBuildStep false true false Make Qt4ProjectManager.MakeStep false 2 Build ProjectExplorer.BuildSteps.Build Make Qt4ProjectManager.MakeStep true clean 1 Clean ProjectExplorer.BuildSteps.Clean 2 false Qt 4.8.1 (System) Debug Qt4ProjectManager.Qt4BuildConfiguration 2 /home/lk/projects/jtech/nlabs_xrdp_tcutils/tcutils-build-desktop-Qt_4_8_1__System__Debug 2 true 4 0 Deploy ProjectExplorer.BuildSteps.Deploy 1 No deployment ProjectExplorer.DefaultDeployConfiguration 1 true true false false false false false false false false true true 0.01 0.01 10 10 true true 25 25 true true valgrind valgrind 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 tcutils Qt4ProjectManager.Qt4RunConfiguration 2 tcutils.pro false false 3768 true false false 1 ProjectExplorer.Project.TargetCount 1 ProjectExplorer.Project.Updater.EnvironmentId {9a0d9632-2baf-44e0-864a-a12692180779} ProjectExplorer.Project.Updater.FileVersion 10 xrdp-0.9.12/tcutils/resources/images/000755 001751 001751 00000000000 13544635323 017456 5ustar00metameta000000 000000 xrdp-0.9.12/tcutils/resources/images/tools.gif000644 001751 001751 00000042545 13544635323 021317 0ustar00metameta000000 000000 GIF89a"&*$).2q#3d7l4"17e%;Z(58,8p9$:=>*@e$?A}!Bn%=)@p,>{A$Bx FF)@CD+@E$D!CI#EI)C*Hw"IK&G0E+IKJ=Go(H1H(I.JNL)J'NyM*JPQ%O7J,Os,JRS!N O*M*N"O3N}-M)P2O#Q%P0LV0NU0O&P&RTV(QU&T [%U1Q(S)S)T8SW4S*U1UYZ,U`2c@c@bHbFcDaIbPa@f7iSc:jPmRnXqXsTr^qe|a{c}kzd`h}xoqsu||x|ΈҎǜɖ䚳ϤДڟۥऴԱ뷾Զ!Created with GIMP! ,x%H.c(\Ȱᘇ#JHE 3jȱ! CdBɒ9RtŌ3^@M2送ALؑţH^,ʔȧ O2De)cja+M;KX@0JЃM*]hڷ BjjՔXs蘡c &kѾm˸Cp>[])j XpM P.Y:^MQ׮!<2#b֬pgp&=0,^6lii;n:|.3gjgrXkT6I ^DnCpCK-y˭`+rTlpsLpkXٔ -HT$R 3̒3yĮw,4!-"HrS'q^ ; rAW|x]jo$C`Dz@5 L`FAEHLԂv;wTv&D)"/#X"V5 {P!L"Ы>t㷽pAslVv50\шb<~90s $+asxo>sCc60%&4Ŷ9A~#U5!VI".F h`ULC=z#xU2;uuիIQr50!%A#T@ճ=[v8?衍>p.PVPqkzw"D@Vp;ag{? Le{#+3z Sd Qk󥎧 1 DЃPvv21mCM+>B/hRFҒ. A"Ѐ+pkvjĽ2rA \hf! E))b @F CK::эsCpP)4i,!ͳ_= 0A%+=q+?`j`P .Lë_Cr/A @dcwԷA\`YpF)/D}:h UnGO${?7J`0f'ԟ䚴@ATLaxPE6_C`6Fx/ Xӡ}3PcX">1;|+&y-s =h.Yףmlc`-pЃ9*pig@XV=&yh(d{<@Jb@÷Y VF\| @FD0Sl&+ ~5e P |ywd'dπ 0ARbf@@GRrvL0W``RWzV`y5 T P PADPD0%0#<716U ugdse%u EpFBGC1;iU{I T-@ 8EPryu^z~,pnp.DP5@3py~ca` AO$ Y)|RMw`W- aUk`kHspF;)c_`ހrpNF0p@ 5 eeA ȈSˈz(~=';@=i PbX`eN Mfe 8P+lP+*CC/hHpPP ȍň ހ mP=[-<n6@MbLjDxiVpdؘYLvbttE<?e70txcmyy @w+pd8gf `@„L9I+<]Ü 4 YUb bp{$-13zQ&3E0&P/ iu PgJ&٦!(Af93_c/E)~ Eg[Pw߀ ~$tW@~ ep,eg!P_8V0` %&j,`ӦS' `+{AO>v˲<.r(L0k EVtP@9`/p@bDR:6M0,Up",2Pj@^t`|h+Q*);w;ܯR{N4d` v >Y#Ep`WV ̆Y`AX ̠\x/JFNt PY*zO9堾v6pr pi9&f>Erv5  " P [5RvvKR7tmY*hp6YsTwsf F@Dv-w-2X E̠e0 0 [rFQP( ;*ƧԆ` EW /] )- PfjSm-do`r5 fC:fvX͒ PbE ` 8 ̔I0g640 /6`u%rw7N[tb c+֥1TC1Y[UH8@w >_L֣we t 9x|i6j(fFn@@HYg^ԮYЗ `hH q5J{AY6dRQE>@ 8^y`=Xg|l uJa~]z/?t\. b0Q!TKRF2x^F8a hNP\<~ °uyp @%ɋv\%„^!δJ#dLgm1鿙ޡZhLlyF|fn1! F|~ n# Ž:;@#0b:YF{|,F4V|Q^XފA"iz9.pLCآ0K{prgǒ7Md:!c =7CVz'%?AG^* +J+Î+.+e $5@oԉ&{npŧ4$pqɁ heXOzu!e;Y!DPaF9b %ŽkVMVzPbS)&%4ccgw)1b e_vR;<3 ÈUEpڇzJqehyDG~@fi\~Dtƒ(B"\W"8Uf- .3AYU-Eg{$7la0aV*&j2b#*ؠ#F@GKsr8'}AVh Ѐ=j-x9zo| rƔd`a@ )a##04 ǝRZ'9@Dp7 )Br*+jHb$%ABR<26L‘@a?;qpb1A=(xS1X!F%Et`\ 7 \tCw@A#9) s$sÇ岵؉ՂD! rP5e 4sRx +cyK%g-%x/S E /4D(Ep@3A J]vn4tC/! st7a 8KDYp'49ꐈ@M;i%e1L0R4 D'zӇޡC%@:FmCl$ CRiof|p[gVvy4A HІ=pEt%P9s|UN"ORlVrH'U#q?ց @ZMJx R#l e†&AP/5.(/vEf2̾ȃ( WЕo^0@X3 N#Fo'% B0Zh1In'UɫtP$hL o+ N'$  ,uPjc{12 K(oyœ5!(YA .] (+=@at78D'8qA.XUxC /ȁ p#4GE0!=r-ɇ, ӏs4`:;MX!4 EB8=@ ߈5QQ1x( y؅9"=8j.PAc 1PPI 06WH{"+?cBi|P-7h>(AJ3$uX!CClh1ɂe(\C>+5[* ^:xxr(8 B "?:hI12hU@#I,`7hHFh4(y Ԛ/ZCC)RgX/=hCC=>A 9X@\# =6Ȅ[Hd,?H,%&44؂@9Y9 [z#|ؕ@+xChAe(D|p/1Ƚd@h5(.Fb,FC;[/3(7099(%\q?3X@8 9( |`#^P X.x$4@b(y'v P \ j@FHt 1`ȊdDF>H?fT9i3@K؀AD$qD?"p=?hYpӋ$0Ήֻ9؂C]syK]Ѐ%H1x.`:4˳SBx20 36РlBϨ X5h`A7C!#"#) 04hr7S ^.Ȃ,E/ P{A;X&>M1QN똈q<8вr\,@PR ȇzLAX\(F8.(#P%:20/,I &P>&\k%mMP ȉa-^CPR(Eȉip E5'^ ĉV b 6R%v>kb?`b)v*EmK)U'?0w")c3kg @`/c<6bM>>vb'b%%%5d EdfTEގF_ƫ'؂, x3FB[גYh%@Ăh/S.b=^AVdWdXRT[-y88=.?bE( [1*7,,0^T%f@~ˍqDvs0򘼗18؂yޡzLF3z\hAف.hl#f!od)Z80;gdh5h؃yȆvac؛o8R,~'SFog"hΠht02MP M(xء uR 2zZi`U?iY)nH;˂AH&R=(Pfw_k$V:0/&SZ{~)q w>cR\[Ww[(1:@A} Ɓp@C"f@2h-_`H2eYګZ2ɥ^wʞuod5B 묀P8jHAh(;IxӴ4Ԇ 8,p/&uA%Z:7 w]x,(:@ yLyI1PF{[A1c{n([hF _/z`zq{F){gy/hc[@es39HLqnňI؄"3z58y "H#nPo|?{}R.vE6A1b9P@3q!Y@"PцP( O}NJ(la"D/^@b"50#"E(9$ʔ*WL%L5a\e 3i#Ek gO_SPJ'NStkʏiԴ5ݧ7|&a,ML?id 33^^Z N"vhӷN ӥq;SyU-N -P9|$޾3 &l0tČ+v /g N2= çԳwwqH.OYݖ{;U50D{UaCEY$XA7ұ!hKԝdOlQE{$#zf[i DV88sI=<1x=SOU5ngO8A t4HVQ:<ڶ?M&[Ѭ; ߼8uaL1rCs;rR;R9{= ~!.b 2Ӻ?޿:6RKM)Drw3L7<U ce.<Ȃppuӛf|O=R(b \0D EQҘAcZ3֎b L 9Ё l.A bp@)]"P0 bl+ ;!D!p<!8>S*Qp@G>b P $ 4BRL1YT?<{z^( EA F5؁nP %b]Z alI>a gvC rLG|Xcdң҇@G LPP|5G p C ~aKfmjpmMPF71@C8S+a)KZԥ"K0ɌhTcw 3 ؃ @$("YH EjZ&e`4:2a P(j8*&>B ,BnЁ}/%:. Y:m  ab,-!XPh<|.@ C}ys Qnt<@7x :կz B+die@`(Ȅ2aRukxdM<у9 AD֧DO RhJ`u=.0 3pk7ٖbhnCXE606:ɸ/ ~p,oh쩇*#z=!tPA1B C8/R8v} $aZ4 n -ۓ p|E$pRnCD\B~&.@֠BtB8R2p&!.Ph;RHjf `+L\ydr+a "^AX7HĢbrCxtA`fLc{ 8$@vG8!7hj6 nP[v`@D,F_-WGp\=7'!8Soai",d˖a 4Bu#͚; 0 )cن9.d/Gh )|`m߽Kxx&`3l! L" qb67g)ł`\LGv_ Qdтb 5XT/ Ǟnal dz zJ˜eû܀4T.\:\2 t@,Afe WNT@2>D=7l VAInUx0 Bȱ:5%dB\4A P%|@l`Nt>c>7x< 8@kfW&!05"ڃt<X@@kkB@vz%uRXA& E:C:>OKTt&QHiy CЁ MYvf `g܀QFhS?bh:J_<X|f}'yAvC8&(`,DP8K\C2,A  i^r LQ{VTc*?>)0}2f-|"#ȃ7\:l&A1Og`X8dhtWb'JAd^ʓ5PϷn)4 >hjD%f'DwDW?*T}j@&Z0ZVũnAH *t$ESkԨ=лt@@t8.jAi,3L/A LЄq"=uy7C$@+dN(ؼDZXRi&U/,l8 0A! HFkZVԀq O G5Mr<@ D̀J:mm $(>X#  2nn 5dBB b>q.cile L HЀ :F}=`=7T΁nDur8o@ zX:* )<7XRԘ]}M@"M,oocBoW E܀\ #詢؃55 ]tp/&jj̀Ăgd76Q@ږp&p̀ tKP@2U#Rp&'_gopl.GVL/$Txl/ Xx @.d2򁲄7mXP9`*@Cj|(`2) BQ l@C54ɖU@112+ '[ Dk@ 7nBEDT%5@l7^燢rW  $ p |@h*DrU4s@ 10ClV&42'2;tWFD 0 54==\]Ml'VeT\ugkU kF@A>B 0+u45k>5C@`\ex ؀](0X|lL3|B @7n4A!Du\uv^gk^k@,Ai:D;ԂȀ06/odװd2/C4y_XHMpdL() 2B@ tWKy/}2E  tD +4Q=*Pp/Vw.7 pe_ ApD'Ă0 0Ђ+4B A 8.@͉_D/ - <$1C*Hd!VFAN^4M k@ P;.\8F93G,9 D11jy|Fyov|A ЀQ ܀ s3d?@?@dBs-O:EXyA akťFpDr0l zln2.뵰WEl v|  \0N_ʟo;B$y {{:7vwDPK@z9| .R$?x8C34Ư#zw޻7~ľcUV9?oDk{w>d?sxx[|'ú@I_uaL?_|{??dG<?@8p`&!>1bE+\иcG3tt1 'otTR%IuĔ#b͈pԹgf0B TԠ .)bUY ic $ș13hP ĕ[RM>=ađ7>X!`ÂWȡbnjCΈѵٙ3fΡc3>diioX-oέkw`yw!%>lP!B`3'GW:G'=1d1ҕ+/b|yG^{h;_[r׿)um7>`!BX!PB( Ȳ %I,D=HQk(OFCF,tzC R!'CԦ2lr[E-ʄn1G 6D%$D2#l'U)J1K7ࠄNCMTQ6,Ҧ4ՄHHEuD9[OӺO/O@ V` -WeԄHiMkW--S6TNk7EFotU RYk6[)͕]>6PE3A_(,pE]jeNuK[oy+X/_xas3u5DwM8Qyޤ6<~u;xrdp-0.9.12/mc/mc.c000644 001751 001751 00000005672 13544635323 013664 0ustar00metameta000000 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" /*****************************************************************************/ /* return error */ int lib_mod_start(struct mod *mod, int w, int h, int bpp) { LIB_DEBUG(mod, "in lib_mod_start"); mod->width = w; mod->height = h; mod->bpp = bpp; LIB_DEBUG(mod, "out lib_mod_start"); return 0; } /******************************************************************************/ /* return error */ int lib_mod_connect(struct mod *mod) { LIB_DEBUG(mod, "in lib_mod_connect"); LIB_DEBUG(mod, "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) { LIB_DEBUG(mod, "in lib_mod_event"); LIB_DEBUG(mod, "out lib_mod_event"); return 0; } /******************************************************************************/ /* return error */ int lib_mod_signal(struct mod *mod) { LIB_DEBUG(mod, "in lib_mod_signal"); LIB_DEBUG(mod, "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.9.12/mc/Makefile.am000644 001751 001751 00000000677 13544635323 015155 0ustar00metameta000000 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 if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG endif 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.9.12/mc/Makefile.in000644 001751 001751 00000052537 13601646126 015165 0ustar00metameta000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG 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 -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } 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)` ETAGS = etags CTAGS = ctags 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@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ 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@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ 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@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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__append_1) 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: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ 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) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-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: xrdp-0.9.12/mc/mc.h000644 001751 001751 00000010346 13544635323 013663 0ustar00metameta000000 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 */ /* include other h files */ #include "arch.h" #include "parse.h" #include "os_calls.h" #include "defines.h" #define CURRENT_MOD_VER 3 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, char* msg, int code); int (*server_is_term)(struct mod* v); 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 (*server_reset)(struct mod* v, int width, int height, int bpp); 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); tintptr server_dumby[100 - 25]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as long */ tintptr wm; tintptr painter; tintptr si; /* mod data */ int sck; int width; int height; int bpp; };