Codebase list virt-viewer / 1ce7c8c
Merge commit 'upstream/0.4.0' Guido Günther 12 years ago
67 changed file(s) with 12326 addition(s) and 5900 deletion(s). Raw diff Collapse all Expand all
131131 DATADIRNAME = @DATADIRNAME@
132132 DEFS = @DEFS@
133133 DEPDIR = @DEPDIR@
134 DLLTOOL = @DLLTOOL@
134135 DSYMUTIL = @DSYMUTIL@
135136 DUMPBIN = @DUMPBIN@
136137 ECHO_C = @ECHO_C@
142143 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
143144 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
144145 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
146 GLIB2_CFLAGS = @GLIB2_CFLAGS@
147 GLIB2_LIBS = @GLIB2_LIBS@
145148 GMOFILES = @GMOFILES@
146149 GMSGFMT = @GMSGFMT@
147150 GREP = @GREP@
148 GTK2_CFLAGS = @GTK2_CFLAGS@
149 GTK2_LIBS = @GTK2_LIBS@
150 GTKVNC_CFLAGS = @GTKVNC_CFLAGS@
151 GTKVNC_LIBS = @GTKVNC_LIBS@
151 GTK_API_VERSION = @GTK_API_VERSION@
152 GTK_CFLAGS = @GTK_CFLAGS@
153 GTK_LIBS = @GTK_LIBS@
154 GTK_REQUIRED = @GTK_REQUIRED@
155 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
156 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
157 GTK_VNC_LIBS = @GTK_VNC_LIBS@
152158 INSTALL = @INSTALL@
153159 INSTALL_DATA = @INSTALL_DATA@
154160 INSTALL_PROGRAM = @INSTALL_PROGRAM@
162168 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
163169 LD = @LD@
164170 LDFLAGS = @LDFLAGS@
165 LIBGLADE2_CFLAGS = @LIBGLADE2_CFLAGS@
166 LIBGLADE2_LIBS = @LIBGLADE2_LIBS@
167171 LIBOBJS = @LIBOBJS@
168172 LIBS = @LIBS@
169173 LIBTOOL = @LIBTOOL@
175179 LN_S = @LN_S@
176180 LTLIBOBJS = @LTLIBOBJS@
177181 MAKEINFO = @MAKEINFO@
182 MANIFEST_TOOL = @MANIFEST_TOOL@
178183 MKDIR_P = @MKDIR_P@
179184 MKINSTALLDIRS = @MKINSTALLDIRS@
180185 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
209214 SED = @SED@
210215 SET_MAKE = @SET_MAKE@
211216 SHELL = @SHELL@
212 SPICEGTK_CFLAGS = @SPICEGTK_CFLAGS@
213 SPICEGTK_LIBS = @SPICEGTK_LIBS@
217 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
218 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
214219 STRIP = @STRIP@
215220 USE_NLS = @USE_NLS@
216221 VERSION = @VERSION@
220225 abs_srcdir = @abs_srcdir@
221226 abs_top_builddir = @abs_top_builddir@
222227 abs_top_srcdir = @abs_top_srcdir@
228 ac_ct_AR = @ac_ct_AR@
223229 ac_ct_CC = @ac_ct_CC@
224230 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
225231 am__include = @am__include@
00 Virt Viewer News
11 ================
2
3 0.4.0: Jul 12, 2011
4 -------------------
5
6 - Require SPICE-GTK >= 0.6
7 - Hide menu bar when going fullscreen
8 - Support building against GTK2 or GTK3
9 - Convert from Glade to GtkBuilder
10 - Honour 'listen' attribute from <graphics> XML when connecting
11 - Fix reconnection after authentication failure
12 - Make --verbose flag actually do something
13 - Enable scaling with SPICE to match VNC behaviour
14 - Rewrite widget resizing code to (try to) be more reliable
15 - Fill extra space outside guest display with black
16 - Fix (null) in title bar while not connected
17 - Fix multiple memory leaks
18 - Fix reconnecting to display with SPICE
219
320 0.3.1: Feb 21, 2011
421 -------------------
22
33 Virt Viewer provides a graphical viewer for the guest OS
44 display. At this time is supports guest OS using the VNC
5 protocol. Further protocols may be supported in the future
6 as user demand dicatates. The viewer can connect directly
7 to both local and remotely hosted guest OS, optionally
5 or SPICE protocols. Further protocols may be supported in
6 the future as user demand dicatates. The viewer can connect
7 directly to both local and remotely hosted guest OS, optionally
88 using SSL/TLS encryption.
9
10 Virt Viewer can be built with either GTK2 or GTK3, with the
11 default option currently being GTK2. The choice can be made
12 with:
13
14 ./configure --with-gtk=3.0 (or =2.0)
915
1016 Virt Viewer uses the GTK-VNC widget to provide a display
1117 of the VNC protocol. This is available from
1319 http://gtk-vnc.sourceforge.net/
1420
1521 Optionally Virt Viewer can also provide a SPICE client
16 using the SPICE-GTK widget (>= 0.5) available from
22 using the SPICE-GTK widget (>= 0.6) available from
1723
1824 http://spice-space.org/page/Spice-Gtk
1925
1212
1313 m4_ifndef([AC_AUTOCONF_VERSION],
1414 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
15 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.66],,
16 [m4_warning([this file was generated for autoconf 2.66.
15 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
16 [m4_warning([this file was generated for autoconf 2.68.
1717 You have another version of autoconf. It may work, but is not guaranteed to.
1818 If you have problems, you may need to regenerate the build system entirely.
1919 To do so, use the procedure documented by the package, typically `autoreconf'.])])
+1478
-713
configure less more
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.66 for virt-viewer 0.3.1.
2 # Generated by GNU Autoconf 2.68 for virt-viewer 0.4.0.
33 #
44 #
55 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
8888 IFS=" "" $as_nl"
8989
9090 # Find who we are. Look in the path if we contain no directory separator.
91 as_myself=
9192 case $0 in #((
9293 *[\\/]* ) as_myself=$0 ;;
9394 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
221222 # We cannot yet assume a decent shell, so we have to provide a
222223 # neutralization value for shells without unset; and this also
223224 # works around shells that cannot unset nonexistent variables.
225 # Preserve -v and -x to the replacement shell.
224226 BASH_ENV=/dev/null
225227 ENV=/dev/null
226228 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
227229 export CONFIG_SHELL
228 exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
230 case $- in # ((((
231 *v*x* | *x*v* ) as_opts=-vx ;;
232 *v* ) as_opts=-v ;;
233 *x* ) as_opts=-x ;;
234 * ) as_opts= ;;
235 esac
236 exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
229237 fi
230238
231239 if test x$as_have_required = xno; then :
558566 # Identity of this package.
559567 PACKAGE_NAME='virt-viewer'
560568 PACKAGE_TARNAME='virt-viewer'
561 PACKAGE_VERSION='0.3.1'
562 PACKAGE_STRING='virt-viewer 0.3.1'
569 PACKAGE_VERSION='0.4.0'
570 PACKAGE_STRING='virt-viewer 0.4.0'
563571 PACKAGE_BUGREPORT=''
564572 PACKAGE_URL=''
565573
566 ac_unique_file="src/main.c"
574 ac_unique_file="src/virt-viewer-main.c"
567575 # Factoring default headers for most tests.
568576 ac_includes_default="\
569577 #include <stdio.h>
615623 NSPR_CFLAGS
616624 HAVE_SPICE_GTK_FALSE
617625 HAVE_SPICE_GTK_TRUE
618 SPICEGTK_LIBS
619 SPICEGTK_CFLAGS
620 GTKVNC_LIBS
621 GTKVNC_CFLAGS
622 LIBGLADE2_LIBS
623 LIBGLADE2_CFLAGS
624 GTK2_LIBS
625 GTK2_CFLAGS
626 SPICE_GTK_LIBS
627 SPICE_GTK_CFLAGS
628 GTK_VNC_LIBS
629 GTK_VNC_CFLAGS
630 GTK_LIBS
631 GTK_CFLAGS
632 HAVE_GTK_3_FALSE
633 HAVE_GTK_3_TRUE
634 HAVE_GTK_2_FALSE
635 HAVE_GTK_2_TRUE
636 GTK_VNC_API_VERSION
637 GTK_REQUIRED
638 GTK_API_VERSION
626639 LIBVIRT_LIBS
627640 LIBVIRT_CFLAGS
628641 LIBXML2_LIBS
629642 LIBXML2_CFLAGS
643 GLIB2_LIBS
644 GLIB2_CFLAGS
630645 PKG_CONFIG_LIBDIR
631646 PKG_CONFIG_PATH
632647 PKG_CONFIG
679694 LIPO
680695 NMEDIT
681696 DSYMUTIL
697 MANIFEST_TOOL
682698 RANLIB
699 ac_ct_AR
683700 AR
701 DLLTOOL
684702 OBJDUMP
685703 LN_S
686704 NM
789807 with_pic
790808 enable_fast_install
791809 with_gnu_ld
810 with_sysroot
792811 enable_libtool_lock
793812 enable_compile_warnings
794813 enable_iso_c
795814 enable_nls
815 with_gtk
796816 with_spice_gtk
797817 enable_plugin
798818 '
808828 PKG_CONFIG
809829 PKG_CONFIG_PATH
810830 PKG_CONFIG_LIBDIR
831 GLIB2_CFLAGS
832 GLIB2_LIBS
811833 LIBXML2_CFLAGS
812834 LIBXML2_LIBS
813835 LIBVIRT_CFLAGS
814836 LIBVIRT_LIBS
815 GTK2_CFLAGS
816 GTK2_LIBS
817 LIBGLADE2_CFLAGS
818 LIBGLADE2_LIBS
819 GTKVNC_CFLAGS
820 GTKVNC_LIBS
821 SPICEGTK_CFLAGS
822 SPICEGTK_LIBS
837 GTK_CFLAGS
838 GTK_LIBS
839 GTK_VNC_CFLAGS
840 GTK_VNC_LIBS
841 SPICE_GTK_CFLAGS
842 SPICE_GTK_LIBS
823843 NSPR_CFLAGS
824844 NSPR_LIBS
825845 FIREFOX_PLUGIN_CFLAGS
888908 fi
889909
890910 case $ac_option in
891 *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
892 *) ac_optarg=yes ;;
911 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
912 *=) ac_optarg= ;;
913 *) ac_optarg=yes ;;
893914 esac
894915
895916 # Accept the important Cygnus configure options, so we can diagnose typos.
12291250 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
12301251 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
12311252 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1232 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
1253 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
12331254 ;;
12341255
12351256 esac
13671388 # Omit some internal or obsolete options to make the list less imposing.
13681389 # This message is too long to be a string in the A/UX 3.1 sh.
13691390 cat <<_ACEOF
1370 \`configure' configures virt-viewer 0.3.1 to adapt to many kinds of systems.
1391 \`configure' configures virt-viewer 0.4.0 to adapt to many kinds of systems.
13711392
13721393 Usage: $0 [OPTION]... [VAR=VALUE]...
13731394
14371458
14381459 if test -n "$ac_init_help"; then
14391460 case $ac_init_help in
1440 short | recursive ) echo "Configuration of virt-viewer 0.3.1:";;
1461 short | recursive ) echo "Configuration of virt-viewer 0.4.0:";;
14411462 esac
14421463 cat <<\_ACEOF
14431464
14661487 --with-pic try to use only PIC/non-PIC objects [default=use
14671488 both]
14681489 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1490 --with-sysroot=DIR Search for dependent libraries within DIR
1491 (or the compiler's sysroot if not specified).
1492 --with-gtk=2.0|3.0 which gtk+ version to compile against (default: 2.0)
14691493 --without-spice-gtk Ignore presence of spice-gtk and disable it
14701494
14711495 Some influential environment variables:
14821506 directories to add to pkg-config's search path
14831507 PKG_CONFIG_LIBDIR
14841508 path overriding pkg-config's built-in search path
1509 GLIB2_CFLAGS
1510 C compiler flags for GLIB2, overriding pkg-config
1511 GLIB2_LIBS linker flags for GLIB2, overriding pkg-config
14851512 LIBXML2_CFLAGS
14861513 C compiler flags for LIBXML2, overriding pkg-config
14871514 LIBXML2_LIBS
14901517 C compiler flags for LIBVIRT, overriding pkg-config
14911518 LIBVIRT_LIBS
14921519 linker flags for LIBVIRT, overriding pkg-config
1493 GTK2_CFLAGS C compiler flags for GTK2, overriding pkg-config
1494 GTK2_LIBS linker flags for GTK2, overriding pkg-config
1495 LIBGLADE2_CFLAGS
1496 C compiler flags for LIBGLADE2, overriding pkg-config
1497 LIBGLADE2_LIBS
1498 linker flags for LIBGLADE2, overriding pkg-config
1499 GTKVNC_CFLAGS
1500 C compiler flags for GTKVNC, overriding pkg-config
1501 GTKVNC_LIBS linker flags for GTKVNC, overriding pkg-config
1502 SPICEGTK_CFLAGS
1503 C compiler flags for SPICEGTK, overriding pkg-config
1504 SPICEGTK_LIBS
1505 linker flags for SPICEGTK, overriding pkg-config
1520 GTK_CFLAGS C compiler flags for GTK, overriding pkg-config
1521 GTK_LIBS linker flags for GTK, overriding pkg-config
1522 GTK_VNC_CFLAGS
1523 C compiler flags for GTK_VNC, overriding pkg-config
1524 GTK_VNC_LIBS
1525 linker flags for GTK_VNC, overriding pkg-config
1526 SPICE_GTK_CFLAGS
1527 C compiler flags for SPICE_GTK, overriding pkg-config
1528 SPICE_GTK_LIBS
1529 linker flags for SPICE_GTK, overriding pkg-config
15061530 NSPR_CFLAGS C compiler flags for NSPR, overriding pkg-config
15071531 NSPR_LIBS linker flags for NSPR, overriding pkg-config
15081532 FIREFOX_PLUGIN_CFLAGS
15801604 test -n "$ac_init_help" && exit $ac_status
15811605 if $ac_init_version; then
15821606 cat <<\_ACEOF
1583 virt-viewer configure 0.3.1
1584 generated by GNU Autoconf 2.66
1607 virt-viewer configure 0.4.0
1608 generated by GNU Autoconf 2.68
15851609
15861610 Copyright (C) 2010 Free Software Foundation, Inc.
15871611 This configure script is free software; the Free Software Foundation
16271651
16281652 ac_retval=1
16291653 fi
1630 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1654 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
16311655 as_fn_set_status $ac_retval
16321656
16331657 } # ac_fn_c_try_compile
16731697 # interfere with the next link command; also delete a directory that is
16741698 # left behind by Apple's compiler. We do this before executing the actions.
16751699 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1676 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1700 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
16771701 as_fn_set_status $ac_retval
16781702
16791703 } # ac_fn_c_try_link
16871711 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
16881712 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
16891713 $as_echo_n "checking for $2... " >&6; }
1690 if eval "test \"\${$3+set}\"" = set; then :
1714 if eval \${$3+:} false; then :
16911715 $as_echo_n "(cached) " >&6
16921716 else
16931717 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17051729 eval ac_res=\$$3
17061730 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17071731 $as_echo "$ac_res" >&6; }
1708 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1732 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17091733
17101734 } # ac_fn_c_check_header_compile
17111735
17301754 mv -f conftest.er1 conftest.err
17311755 fi
17321756 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1733 test $ac_status = 0; } >/dev/null && {
1757 test $ac_status = 0; } > conftest.i && {
17341758 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
17351759 test ! -s conftest.err
17361760 }; then :
17411765
17421766 ac_retval=1
17431767 fi
1744 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1768 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17451769 as_fn_set_status $ac_retval
17461770
17471771 } # ac_fn_c_try_cpp
17831807 ac_retval=$ac_status
17841808 fi
17851809 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1786 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1810 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17871811 as_fn_set_status $ac_retval
17881812
17891813 } # ac_fn_c_try_run
17961820 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
17971821 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
17981822 $as_echo_n "checking for $2... " >&6; }
1799 if eval "test \"\${$3+set}\"" = set; then :
1823 if eval \${$3+:} false; then :
18001824 $as_echo_n "(cached) " >&6
18011825 else
18021826 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18511875 eval ac_res=\$$3
18521876 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
18531877 $as_echo "$ac_res" >&6; }
1854 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1878 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
18551879
18561880 } # ac_fn_c_check_func
18571881
18631887 ac_fn_c_check_header_mongrel ()
18641888 {
18651889 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1866 if eval "test \"\${$3+set}\"" = set; then :
1890 if eval \${$3+:} false; then :
18671891 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
18681892 $as_echo_n "checking for $2... " >&6; }
1869 if eval "test \"\${$3+set}\"" = set; then :
1893 if eval \${$3+:} false; then :
18701894 $as_echo_n "(cached) " >&6
18711895 fi
18721896 eval ac_res=\$$3
19021926 else
19031927 ac_header_preproc=no
19041928 fi
1905 rm -f conftest.err conftest.$ac_ext
1929 rm -f conftest.err conftest.i conftest.$ac_ext
19061930 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
19071931 $as_echo "$ac_header_preproc" >&6; }
19081932
19291953 esac
19301954 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
19311955 $as_echo_n "checking for $2... " >&6; }
1932 if eval "test \"\${$3+set}\"" = set; then :
1956 if eval \${$3+:} false; then :
19331957 $as_echo_n "(cached) " >&6
19341958 else
19351959 eval "$3=\$ac_header_compiler"
19381962 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
19391963 $as_echo "$ac_res" >&6; }
19401964 fi
1941 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1965 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
19421966
19431967 } # ac_fn_c_check_header_mongrel
19441968 cat >config.log <<_ACEOF
19451969 This file contains any messages produced by compilers while
19461970 running configure, to aid debugging if configure makes a mistake.
19471971
1948 It was created by virt-viewer $as_me 0.3.1, which was
1949 generated by GNU Autoconf 2.66. Invocation command line was
1972 It was created by virt-viewer $as_me 0.4.0, which was
1973 generated by GNU Autoconf 2.68. Invocation command line was
19501974
19511975 $ $0 $@
19521976
23442368 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
23452369 $as_echo_n "checking for a BSD-compatible install... " >&6; }
23462370 if test -z "$INSTALL"; then
2347 if test "${ac_cv_path_install+set}" = set; then :
2371 if ${ac_cv_path_install+:} false; then :
23482372 $as_echo_n "(cached) " >&6
23492373 else
23502374 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
25212545 set dummy ${ac_tool_prefix}strip; ac_word=$2
25222546 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
25232547 $as_echo_n "checking for $ac_word... " >&6; }
2524 if test "${ac_cv_prog_STRIP+set}" = set; then :
2548 if ${ac_cv_prog_STRIP+:} false; then :
25252549 $as_echo_n "(cached) " >&6
25262550 else
25272551 if test -n "$STRIP"; then
25612585 set dummy strip; ac_word=$2
25622586 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
25632587 $as_echo_n "checking for $ac_word... " >&6; }
2564 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
2588 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
25652589 $as_echo_n "(cached) " >&6
25662590 else
25672591 if test -n "$ac_ct_STRIP"; then
26142638 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
26152639 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
26162640 if test -z "$MKDIR_P"; then
2617 if test "${ac_cv_path_mkdir+set}" = set; then :
2641 if ${ac_cv_path_mkdir+:} false; then :
26182642 $as_echo_n "(cached) " >&6
26192643 else
26202644 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
26652689 set dummy $ac_prog; ac_word=$2
26662690 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
26672691 $as_echo_n "checking for $ac_word... " >&6; }
2668 if test "${ac_cv_prog_AWK+set}" = set; then :
2692 if ${ac_cv_prog_AWK+:} false; then :
26692693 $as_echo_n "(cached) " >&6
26702694 else
26712695 if test -n "$AWK"; then
27052729 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
27062730 set x ${MAKE-make}
27072731 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
2708 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
2732 if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
27092733 $as_echo_n "(cached) " >&6
27102734 else
27112735 cat >conftest.make <<\_ACEOF
27632787
27642788 # Define the identity of the package.
27652789 PACKAGE='virt-viewer'
2766 VERSION='0.3.1'
2790 VERSION='0.4.0'
27672791
27682792
27692793 cat >>confdefs.h <<_ACEOF
28092833
28102834 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
28112835 $as_echo_n "checking build system type... " >&6; }
2812 if test "${ac_cv_build+set}" = set; then :
2836 if ${ac_cv_build+:} false; then :
28132837 $as_echo_n "(cached) " >&6
28142838 else
28152839 ac_build_alias=$build_alias
28432867
28442868 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
28452869 $as_echo_n "checking host system type... " >&6; }
2846 if test "${ac_cv_host+set}" = set; then :
2870 if ${ac_cv_host+:} false; then :
28472871 $as_echo_n "(cached) " >&6
28482872 else
28492873 if test "x$host_alias" = x; then
28902914 AM_BACKSLASH='\'
28912915
28922916
2917 GLIB2_REQUIRED=2.12.0
2918 LIBXML2_REQUIRED="2.6.0"
2919 LIBVIRT_REQUIRED="0.6.0"
2920 GTK2_REQUIRED="2.12.0"
2921 GTK3_REQUIRED="3.0"
2922 GTK_VNC_REQUIRED="0.3.8"
2923 SPICE_GTK_REQUIRED="0.6"
2924
28932925 ac_ext=c
28942926 ac_cpp='$CPP $CPPFLAGS'
28952927 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
29002932 set dummy ${ac_tool_prefix}gcc; ac_word=$2
29012933 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29022934 $as_echo_n "checking for $ac_word... " >&6; }
2903 if test "${ac_cv_prog_CC+set}" = set; then :
2935 if ${ac_cv_prog_CC+:} false; then :
29042936 $as_echo_n "(cached) " >&6
29052937 else
29062938 if test -n "$CC"; then
29402972 set dummy gcc; ac_word=$2
29412973 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29422974 $as_echo_n "checking for $ac_word... " >&6; }
2943 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
2975 if ${ac_cv_prog_ac_ct_CC+:} false; then :
29442976 $as_echo_n "(cached) " >&6
29452977 else
29462978 if test -n "$ac_ct_CC"; then
29933025 set dummy ${ac_tool_prefix}cc; ac_word=$2
29943026 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29953027 $as_echo_n "checking for $ac_word... " >&6; }
2996 if test "${ac_cv_prog_CC+set}" = set; then :
3028 if ${ac_cv_prog_CC+:} false; then :
29973029 $as_echo_n "(cached) " >&6
29983030 else
29993031 if test -n "$CC"; then
30333065 set dummy cc; ac_word=$2
30343066 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30353067 $as_echo_n "checking for $ac_word... " >&6; }
3036 if test "${ac_cv_prog_CC+set}" = set; then :
3068 if ${ac_cv_prog_CC+:} false; then :
30373069 $as_echo_n "(cached) " >&6
30383070 else
30393071 if test -n "$CC"; then
30923124 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
30933125 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30943126 $as_echo_n "checking for $ac_word... " >&6; }
3095 if test "${ac_cv_prog_CC+set}" = set; then :
3127 if ${ac_cv_prog_CC+:} false; then :
30963128 $as_echo_n "(cached) " >&6
30973129 else
30983130 if test -n "$CC"; then
31363168 set dummy $ac_prog; ac_word=$2
31373169 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31383170 $as_echo_n "checking for $ac_word... " >&6; }
3139 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
3171 if ${ac_cv_prog_ac_ct_CC+:} false; then :
31403172 $as_echo_n "(cached) " >&6
31413173 else
31423174 if test -n "$ac_ct_CC"; then
34193451 ac_clean_files=$ac_clean_files_save
34203452 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
34213453 $as_echo_n "checking for suffix of object files... " >&6; }
3422 if test "${ac_cv_objext+set}" = set; then :
3454 if ${ac_cv_objext+:} false; then :
34233455 $as_echo_n "(cached) " >&6
34243456 else
34253457 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34703502 ac_objext=$OBJEXT
34713503 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
34723504 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
3473 if test "${ac_cv_c_compiler_gnu+set}" = set; then :
3505 if ${ac_cv_c_compiler_gnu+:} false; then :
34743506 $as_echo_n "(cached) " >&6
34753507 else
34763508 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35073539 ac_save_CFLAGS=$CFLAGS
35083540 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
35093541 $as_echo_n "checking whether $CC accepts -g... " >&6; }
3510 if test "${ac_cv_prog_cc_g+set}" = set; then :
3542 if ${ac_cv_prog_cc_g+:} false; then :
35113543 $as_echo_n "(cached) " >&6
35123544 else
35133545 ac_save_c_werror_flag=$ac_c_werror_flag
35853617 fi
35863618 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
35873619 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
3588 if test "${ac_cv_prog_cc_c89+set}" = set; then :
3620 if ${ac_cv_prog_cc_c89+:} false; then :
35893621 $as_echo_n "(cached) " >&6
35903622 else
35913623 ac_cv_prog_cc_c89=no
37463778
37473779 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
37483780 $as_echo_n "checking dependency style of $depcc... " >&6; }
3749 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
3781 if ${am_cv_CC_dependencies_compiler_type+:} false; then :
37503782 $as_echo_n "(cached) " >&6
37513783 else
37523784 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
38783910 fi
38793911 set dummy $CC; ac_cc=`$as_echo "$2" |
38803912 sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
3881 if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then :
3913 if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
38823914 $as_echo_n "(cached) " >&6
38833915 else
38843916 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40034035
40044036
40054037
4006 macro_version='2.2.10'
4007 macro_revision='1.3175'
4038 macro_version='2.4'
4039 macro_revision='1.3293'
40084040
40094041
40104042
40444076 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
40454077 $as_echo_n "checking how to print strings... " >&6; }
40464078 # Test print first, because it will be a builtin if present.
4047 if test "X`print -r -- -n 2>/dev/null`" = X-n && \
4079 if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
40484080 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
40494081 ECHO='print -r --'
40504082 elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
40914123
40924124 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
40934125 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
4094 if test "${ac_cv_path_SED+set}" = set; then :
4126 if ${ac_cv_path_SED+:} false; then :
40954127 $as_echo_n "(cached) " >&6
40964128 else
40974129 ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
41734205
41744206 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
41754207 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4176 if test "${ac_cv_path_GREP+set}" = set; then :
4208 if ${ac_cv_path_GREP+:} false; then :
41774209 $as_echo_n "(cached) " >&6
41784210 else
41794211 if test -z "$GREP"; then
42364268
42374269 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
42384270 $as_echo_n "checking for egrep... " >&6; }
4239 if test "${ac_cv_path_EGREP+set}" = set; then :
4271 if ${ac_cv_path_EGREP+:} false; then :
42404272 $as_echo_n "(cached) " >&6
42414273 else
42424274 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
43034335
43044336 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
43054337 $as_echo_n "checking for fgrep... " >&6; }
4306 if test "${ac_cv_path_FGREP+set}" = set; then :
4338 if ${ac_cv_path_FGREP+:} false; then :
43074339 $as_echo_n "(cached) " >&6
43084340 else
43094341 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
44344466 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
44354467 $as_echo_n "checking for non-GNU ld... " >&6; }
44364468 fi
4437 if test "${lt_cv_path_LD+set}" = set; then :
4469 if ${lt_cv_path_LD+:} false; then :
44384470 $as_echo_n "(cached) " >&6
44394471 else
44404472 if test -z "$LD"; then
44744506 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
44754507 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
44764508 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
4477 if test "${lt_cv_prog_gnu_ld+set}" = set; then :
4509 if ${lt_cv_prog_gnu_ld+:} false; then :
44784510 $as_echo_n "(cached) " >&6
44794511 else
44804512 # I'd rather use --version here, but apparently some GNU lds only accept -v.
45014533
45024534 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
45034535 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
4504 if test "${lt_cv_path_NM+set}" = set; then :
4536 if ${lt_cv_path_NM+:} false; then :
45054537 $as_echo_n "(cached) " >&6
45064538 else
45074539 if test -n "$NM"; then
45644596 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
45654597 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
45664598 $as_echo_n "checking for $ac_word... " >&6; }
4567 if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
4599 if ${ac_cv_prog_DUMPBIN+:} false; then :
45684600 $as_echo_n "(cached) " >&6
45694601 else
45704602 if test -n "$DUMPBIN"; then
46084640 set dummy $ac_prog; ac_word=$2
46094641 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
46104642 $as_echo_n "checking for $ac_word... " >&6; }
4611 if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
4643 if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
46124644 $as_echo_n "(cached) " >&6
46134645 else
46144646 if test -n "$ac_ct_DUMPBIN"; then
46804712
46814713 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
46824714 $as_echo_n "checking the name lister ($NM) interface... " >&6; }
4683 if test "${lt_cv_nm_interface+set}" = set; then :
4715 if ${lt_cv_nm_interface+:} false; then :
46844716 $as_echo_n "(cached) " >&6
46854717 else
46864718 lt_cv_nm_interface="BSD nm"
47154747 # find the maximum length of command line arguments
47164748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
47174749 $as_echo_n "checking the maximum length of command line arguments... " >&6; }
4718 if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
4750 if ${lt_cv_sys_max_cmd_len+:} false; then :
47194751 $as_echo_n "(cached) " >&6
47204752 else
47214753 i=0
48604892 # Try some XSI features
48614893 xsi_shell=no
48624894 ( _lt_dummy="a/b/c"
4863 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
4864 = c,a/b,, \
4895 test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
4896 = c,a/b,b/c, \
48654897 && eval 'test $(( 1 + 1 )) -eq 2 \
48664898 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
48674899 && xsi_shell=yes
49104942
49114943
49124944
4945 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
4946 $as_echo_n "checking how to convert $build file names to $host format... " >&6; }
4947 if ${lt_cv_to_host_file_cmd+:} false; then :
4948 $as_echo_n "(cached) " >&6
4949 else
4950 case $host in
4951 *-*-mingw* )
4952 case $build in
4953 *-*-mingw* ) # actually msys
4954 lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
4955 ;;
4956 *-*-cygwin* )
4957 lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
4958 ;;
4959 * ) # otherwise, assume *nix
4960 lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
4961 ;;
4962 esac
4963 ;;
4964 *-*-cygwin* )
4965 case $build in
4966 *-*-mingw* ) # actually msys
4967 lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
4968 ;;
4969 *-*-cygwin* )
4970 lt_cv_to_host_file_cmd=func_convert_file_noop
4971 ;;
4972 * ) # otherwise, assume *nix
4973 lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
4974 ;;
4975 esac
4976 ;;
4977 * ) # unhandled hosts (and "normal" native builds)
4978 lt_cv_to_host_file_cmd=func_convert_file_noop
4979 ;;
4980 esac
4981
4982 fi
4983
4984 to_host_file_cmd=$lt_cv_to_host_file_cmd
4985 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
4986 $as_echo "$lt_cv_to_host_file_cmd" >&6; }
4987
4988
4989
4990
4991
4992 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
4993 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
4994 if ${lt_cv_to_tool_file_cmd+:} false; then :
4995 $as_echo_n "(cached) " >&6
4996 else
4997 #assume ordinary cross tools, or native build.
4998 lt_cv_to_tool_file_cmd=func_convert_file_noop
4999 case $host in
5000 *-*-mingw* )
5001 case $build in
5002 *-*-mingw* ) # actually msys
5003 lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
5004 ;;
5005 esac
5006 ;;
5007 esac
5008
5009 fi
5010
5011 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
5012 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
5013 $as_echo "$lt_cv_to_tool_file_cmd" >&6; }
5014
5015
5016
5017
5018
49135019 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
49145020 $as_echo_n "checking for $LD option to reload object files... " >&6; }
4915 if test "${lt_cv_ld_reload_flag+set}" = set; then :
5021 if ${lt_cv_ld_reload_flag+:} false; then :
49165022 $as_echo_n "(cached) " >&6
49175023 else
49185024 lt_cv_ld_reload_flag='-r'
49265032 esac
49275033 reload_cmds='$LD$reload_flag -o $output$reload_objs'
49285034 case $host_os in
5035 cygwin* | mingw* | pw32* | cegcc*)
5036 if test "$GCC" != yes; then
5037 reload_cmds=false
5038 fi
5039 ;;
49295040 darwin*)
49305041 if test "$GCC" = yes; then
49315042 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
49485059 set dummy ${ac_tool_prefix}objdump; ac_word=$2
49495060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
49505061 $as_echo_n "checking for $ac_word... " >&6; }
4951 if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
5062 if ${ac_cv_prog_OBJDUMP+:} false; then :
49525063 $as_echo_n "(cached) " >&6
49535064 else
49545065 if test -n "$OBJDUMP"; then
49885099 set dummy objdump; ac_word=$2
49895100 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
49905101 $as_echo_n "checking for $ac_word... " >&6; }
4991 if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
5102 if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
49925103 $as_echo_n "(cached) " >&6
49935104 else
49945105 if test -n "$ac_ct_OBJDUMP"; then
50475158
50485159 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
50495160 $as_echo_n "checking how to recognize dependent libraries... " >&6; }
5050 if test "${lt_cv_deplibs_check_method+set}" = set; then :
5161 if ${lt_cv_deplibs_check_method+:} false; then :
50515162 $as_echo_n "(cached) " >&6
50525163 else
50535164 lt_cv_file_magic_cmd='$MAGIC_CMD'
52495360 fi
52505361 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
52515362 $as_echo "$lt_cv_deplibs_check_method" >&6; }
5363
5364 file_magic_glob=
5365 want_nocaseglob=no
5366 if test "$build" = "$host"; then
5367 case $host_os in
5368 mingw* | pw32*)
5369 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
5370 want_nocaseglob=yes
5371 else
5372 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
5373 fi
5374 ;;
5375 esac
5376 fi
5377
52525378 file_magic_cmd=$lt_cv_file_magic_cmd
52535379 deplibs_check_method=$lt_cv_deplibs_check_method
52545380 test -z "$deplibs_check_method" && deplibs_check_method=unknown
52645390
52655391
52665392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
52675403 if test -n "$ac_tool_prefix"; then
5268 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
5269 set dummy ${ac_tool_prefix}ar; ac_word=$2
5404 # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
5405 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
52705406 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
52715407 $as_echo_n "checking for $ac_word... " >&6; }
5272 if test "${ac_cv_prog_AR+set}" = set; then :
5408 if ${ac_cv_prog_DLLTOOL+:} false; then :
52735409 $as_echo_n "(cached) " >&6
52745410 else
5275 if test -n "$AR"; then
5276 ac_cv_prog_AR="$AR" # Let the user override the test.
5411 if test -n "$DLLTOOL"; then
5412 ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
52775413 else
52785414 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
52795415 for as_dir in $PATH
52825418 test -z "$as_dir" && as_dir=.
52835419 for ac_exec_ext in '' $ac_executable_extensions; do
52845420 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5285 ac_cv_prog_AR="${ac_tool_prefix}ar"
5421 ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
52865422 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
52875423 break 2
52885424 fi
52925428
52935429 fi
52945430 fi
5295 AR=$ac_cv_prog_AR
5296 if test -n "$AR"; then
5297 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5298 $as_echo "$AR" >&6; }
5431 DLLTOOL=$ac_cv_prog_DLLTOOL
5432 if test -n "$DLLTOOL"; then
5433 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
5434 $as_echo "$DLLTOOL" >&6; }
52995435 else
53005436 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53015437 $as_echo "no" >&6; }
53035439
53045440
53055441 fi
5306 if test -z "$ac_cv_prog_AR"; then
5307 ac_ct_AR=$AR
5308 # Extract the first word of "ar", so it can be a program name with args.
5309 set dummy ar; ac_word=$2
5442 if test -z "$ac_cv_prog_DLLTOOL"; then
5443 ac_ct_DLLTOOL=$DLLTOOL
5444 # Extract the first word of "dlltool", so it can be a program name with args.
5445 set dummy dlltool; ac_word=$2
53105446 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
53115447 $as_echo_n "checking for $ac_word... " >&6; }
5312 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
5448 if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
53135449 $as_echo_n "(cached) " >&6
53145450 else
5315 if test -n "$ac_ct_AR"; then
5316 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5451 if test -n "$ac_ct_DLLTOOL"; then
5452 ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
53175453 else
53185454 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
53195455 for as_dir in $PATH
53225458 test -z "$as_dir" && as_dir=.
53235459 for ac_exec_ext in '' $ac_executable_extensions; do
53245460 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5325 ac_cv_prog_ac_ct_AR="ar"
5461 ac_cv_prog_ac_ct_DLLTOOL="dlltool"
53265462 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
53275463 break 2
53285464 fi
53325468
53335469 fi
53345470 fi
5471 ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
5472 if test -n "$ac_ct_DLLTOOL"; then
5473 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
5474 $as_echo "$ac_ct_DLLTOOL" >&6; }
5475 else
5476 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5477 $as_echo "no" >&6; }
5478 fi
5479
5480 if test "x$ac_ct_DLLTOOL" = x; then
5481 DLLTOOL="false"
5482 else
5483 case $cross_compiling:$ac_tool_warned in
5484 yes:)
5485 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5486 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5487 ac_tool_warned=yes ;;
5488 esac
5489 DLLTOOL=$ac_ct_DLLTOOL
5490 fi
5491 else
5492 DLLTOOL="$ac_cv_prog_DLLTOOL"
5493 fi
5494
5495 test -z "$DLLTOOL" && DLLTOOL=dlltool
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
5507 $as_echo_n "checking how to associate runtime and link libraries... " >&6; }
5508 if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
5509 $as_echo_n "(cached) " >&6
5510 else
5511 lt_cv_sharedlib_from_linklib_cmd='unknown'
5512
5513 case $host_os in
5514 cygwin* | mingw* | pw32* | cegcc*)
5515 # two different shell functions defined in ltmain.sh
5516 # decide which to use based on capabilities of $DLLTOOL
5517 case `$DLLTOOL --help 2>&1` in
5518 *--identify-strict*)
5519 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
5520 ;;
5521 *)
5522 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
5523 ;;
5524 esac
5525 ;;
5526 *)
5527 # fallback: assume linklib IS sharedlib
5528 lt_cv_sharedlib_from_linklib_cmd="$ECHO"
5529 ;;
5530 esac
5531
5532 fi
5533 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
5534 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
5535 sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
5536 test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
5537
5538
5539
5540
5541
5542
5543
5544
5545 if test -n "$ac_tool_prefix"; then
5546 for ac_prog in ar
5547 do
5548 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5549 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5550 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5551 $as_echo_n "checking for $ac_word... " >&6; }
5552 if ${ac_cv_prog_AR+:} false; then :
5553 $as_echo_n "(cached) " >&6
5554 else
5555 if test -n "$AR"; then
5556 ac_cv_prog_AR="$AR" # Let the user override the test.
5557 else
5558 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5559 for as_dir in $PATH
5560 do
5561 IFS=$as_save_IFS
5562 test -z "$as_dir" && as_dir=.
5563 for ac_exec_ext in '' $ac_executable_extensions; do
5564 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5565 ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
5566 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5567 break 2
5568 fi
5569 done
5570 done
5571 IFS=$as_save_IFS
5572
5573 fi
5574 fi
5575 AR=$ac_cv_prog_AR
5576 if test -n "$AR"; then
5577 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5578 $as_echo "$AR" >&6; }
5579 else
5580 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5581 $as_echo "no" >&6; }
5582 fi
5583
5584
5585 test -n "$AR" && break
5586 done
5587 fi
5588 if test -z "$AR"; then
5589 ac_ct_AR=$AR
5590 for ac_prog in ar
5591 do
5592 # Extract the first word of "$ac_prog", so it can be a program name with args.
5593 set dummy $ac_prog; ac_word=$2
5594 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5595 $as_echo_n "checking for $ac_word... " >&6; }
5596 if ${ac_cv_prog_ac_ct_AR+:} false; then :
5597 $as_echo_n "(cached) " >&6
5598 else
5599 if test -n "$ac_ct_AR"; then
5600 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5601 else
5602 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5603 for as_dir in $PATH
5604 do
5605 IFS=$as_save_IFS
5606 test -z "$as_dir" && as_dir=.
5607 for ac_exec_ext in '' $ac_executable_extensions; do
5608 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5609 ac_cv_prog_ac_ct_AR="$ac_prog"
5610 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5611 break 2
5612 fi
5613 done
5614 done
5615 IFS=$as_save_IFS
5616
5617 fi
5618 fi
53355619 ac_ct_AR=$ac_cv_prog_ac_ct_AR
53365620 if test -n "$ac_ct_AR"; then
53375621 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
53405624 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53415625 $as_echo "no" >&6; }
53425626 fi
5627
5628
5629 test -n "$ac_ct_AR" && break
5630 done
53435631
53445632 if test "x$ac_ct_AR" = x; then
53455633 AR="false"
53525640 esac
53535641 AR=$ac_ct_AR
53545642 fi
5355 else
5356 AR="$ac_cv_prog_AR"
5357 fi
5358
5359 test -z "$AR" && AR=ar
5360 test -z "$AR_FLAGS" && AR_FLAGS=cru
5361
5362
5363
5364
5643 fi
5644
5645 : ${AR=ar}
5646 : ${AR_FLAGS=cru}
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
5659 $as_echo_n "checking for archiver @FILE support... " >&6; }
5660 if ${lt_cv_ar_at_file+:} false; then :
5661 $as_echo_n "(cached) " >&6
5662 else
5663 lt_cv_ar_at_file=no
5664 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5665 /* end confdefs.h. */
5666
5667 int
5668 main ()
5669 {
5670
5671 ;
5672 return 0;
5673 }
5674 _ACEOF
5675 if ac_fn_c_try_compile "$LINENO"; then :
5676 echo conftest.$ac_objext > conftest.lst
5677 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
5678 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
5679 (eval $lt_ar_try) 2>&5
5680 ac_status=$?
5681 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5682 test $ac_status = 0; }
5683 if test "$ac_status" -eq 0; then
5684 # Ensure the archiver fails upon bogus file names.
5685 rm -f conftest.$ac_objext libconftest.a
5686 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
5687 (eval $lt_ar_try) 2>&5
5688 ac_status=$?
5689 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5690 test $ac_status = 0; }
5691 if test "$ac_status" -ne 0; then
5692 lt_cv_ar_at_file=@
5693 fi
5694 fi
5695 rm -f conftest.* libconftest.a
5696
5697 fi
5698 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5699
5700 fi
5701 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
5702 $as_echo "$lt_cv_ar_at_file" >&6; }
5703
5704 if test "x$lt_cv_ar_at_file" = xno; then
5705 archiver_list_spec=
5706 else
5707 archiver_list_spec=$lt_cv_ar_at_file
5708 fi
53655709
53665710
53675711
53745718 set dummy ${ac_tool_prefix}strip; ac_word=$2
53755719 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
53765720 $as_echo_n "checking for $ac_word... " >&6; }
5377 if test "${ac_cv_prog_STRIP+set}" = set; then :
5721 if ${ac_cv_prog_STRIP+:} false; then :
53785722 $as_echo_n "(cached) " >&6
53795723 else
53805724 if test -n "$STRIP"; then
54145758 set dummy strip; ac_word=$2
54155759 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
54165760 $as_echo_n "checking for $ac_word... " >&6; }
5417 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
5761 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
54185762 $as_echo_n "(cached) " >&6
54195763 else
54205764 if test -n "$ac_ct_STRIP"; then
54735817 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
54745818 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
54755819 $as_echo_n "checking for $ac_word... " >&6; }
5476 if test "${ac_cv_prog_RANLIB+set}" = set; then :
5820 if ${ac_cv_prog_RANLIB+:} false; then :
54775821 $as_echo_n "(cached) " >&6
54785822 else
54795823 if test -n "$RANLIB"; then
55135857 set dummy ranlib; ac_word=$2
55145858 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
55155859 $as_echo_n "checking for $ac_word... " >&6; }
5516 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
5860 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
55175861 $as_echo_n "(cached) " >&6
55185862 else
55195863 if test -n "$ac_ct_RANLIB"; then
56425986 # Check for command to grab the raw symbol name followed by C symbol from nm.
56435987 { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
56445988 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
5645 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
5989 if ${lt_cv_sys_global_symbol_pipe+:} false; then :
56465990 $as_echo_n "(cached) " >&6
56475991 else
56485992
57036047 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
57046048
57056049 # Transform an extracted symbol line into symbol name and symbol address
5706 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
5707 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
6050 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
6051 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
57086052
57096053 # Handle CRLF in mingw tool chain
57106054 opt_cr=
57406084 else
57416085 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
57426086 fi
6087 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
57436088
57446089 # Check to see that the pipe works correctly.
57456090 pipe_works=no
57816126 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
57826127 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
57836128 cat <<_LT_EOF > conftest.$ac_ext
6129 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
6130 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
6131 /* DATA imports from DLLs on WIN32 con't be const, because runtime
6132 relocations are performed -- see ld's documentation on pseudo-relocs. */
6133 # define LT_DLSYM_CONST
6134 #elif defined(__osf__)
6135 /* This system does not cope well with relocations in const data. */
6136 # define LT_DLSYM_CONST
6137 #else
6138 # define LT_DLSYM_CONST const
6139 #endif
6140
57846141 #ifdef __cplusplus
57856142 extern "C" {
57866143 #endif
57926149 cat <<_LT_EOF >> conftest.$ac_ext
57936150
57946151 /* The mapping between symbol names and symbols. */
5795 const struct {
6152 LT_DLSYM_CONST struct {
57966153 const char *name;
57976154 void *address;
57986155 }
58186175 _LT_EOF
58196176 # Now try linking the two files.
58206177 mv conftest.$ac_objext conftstm.$ac_objext
5821 lt_save_LIBS="$LIBS"
5822 lt_save_CFLAGS="$CFLAGS"
6178 lt_globsym_save_LIBS=$LIBS
6179 lt_globsym_save_CFLAGS=$CFLAGS
58236180 LIBS="conftstm.$ac_objext"
58246181 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
58256182 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
58296186 test $ac_status = 0; } && test -s conftest${ac_exeext}; then
58306187 pipe_works=yes
58316188 fi
5832 LIBS="$lt_save_LIBS"
5833 CFLAGS="$lt_save_CFLAGS"
6189 LIBS=$lt_globsym_save_LIBS
6190 CFLAGS=$lt_globsym_save_CFLAGS
58346191 else
58356192 echo "cannot find nm_test_func in $nlist" >&5
58366193 fi
58676224 $as_echo "ok" >&6; }
58686225 fi
58696226
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
6227 # Response file support.
6228 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6229 nm_file_list_spec='@'
6230 elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
6231 nm_file_list_spec='@'
6232 fi
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
6261 $as_echo_n "checking for sysroot... " >&6; }
6262
6263 # Check whether --with-sysroot was given.
6264 if test "${with_sysroot+set}" = set; then :
6265 withval=$with_sysroot;
6266 else
6267 with_sysroot=no
6268 fi
6269
6270
6271 lt_sysroot=
6272 case ${with_sysroot} in #(
6273 yes)
6274 if test "$GCC" = yes; then
6275 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
6276 fi
6277 ;; #(
6278 /*)
6279 lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
6280 ;; #(
6281 no|'')
6282 ;; #(
6283 *)
6284 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
6285 $as_echo "${with_sysroot}" >&6; }
6286 as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
6287 ;;
6288 esac
6289
6290 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
6291 $as_echo "${lt_sysroot:-no}" >&6; }
58876292
58886293
58896294
60146419 CFLAGS="$CFLAGS -belf"
60156420 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
60166421 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
6017 if test "${lt_cv_cc_needs_belf+set}" = set; then :
6422 if ${lt_cv_cc_needs_belf+:} false; then :
60186423 $as_echo_n "(cached) " >&6
60196424 else
60206425 ac_ext=c
60826487
60836488 need_locks="$enable_libtool_lock"
60846489
6490 if test -n "$ac_tool_prefix"; then
6491 # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
6492 set dummy ${ac_tool_prefix}mt; ac_word=$2
6493 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6494 $as_echo_n "checking for $ac_word... " >&6; }
6495 if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
6496 $as_echo_n "(cached) " >&6
6497 else
6498 if test -n "$MANIFEST_TOOL"; then
6499 ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
6500 else
6501 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6502 for as_dir in $PATH
6503 do
6504 IFS=$as_save_IFS
6505 test -z "$as_dir" && as_dir=.
6506 for ac_exec_ext in '' $ac_executable_extensions; do
6507 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6508 ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
6509 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6510 break 2
6511 fi
6512 done
6513 done
6514 IFS=$as_save_IFS
6515
6516 fi
6517 fi
6518 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
6519 if test -n "$MANIFEST_TOOL"; then
6520 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
6521 $as_echo "$MANIFEST_TOOL" >&6; }
6522 else
6523 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6524 $as_echo "no" >&6; }
6525 fi
6526
6527
6528 fi
6529 if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
6530 ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
6531 # Extract the first word of "mt", so it can be a program name with args.
6532 set dummy mt; ac_word=$2
6533 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6534 $as_echo_n "checking for $ac_word... " >&6; }
6535 if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
6536 $as_echo_n "(cached) " >&6
6537 else
6538 if test -n "$ac_ct_MANIFEST_TOOL"; then
6539 ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
6540 else
6541 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6542 for as_dir in $PATH
6543 do
6544 IFS=$as_save_IFS
6545 test -z "$as_dir" && as_dir=.
6546 for ac_exec_ext in '' $ac_executable_extensions; do
6547 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6548 ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
6549 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6550 break 2
6551 fi
6552 done
6553 done
6554 IFS=$as_save_IFS
6555
6556 fi
6557 fi
6558 ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
6559 if test -n "$ac_ct_MANIFEST_TOOL"; then
6560 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
6561 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
6562 else
6563 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6564 $as_echo "no" >&6; }
6565 fi
6566
6567 if test "x$ac_ct_MANIFEST_TOOL" = x; then
6568 MANIFEST_TOOL=":"
6569 else
6570 case $cross_compiling:$ac_tool_warned in
6571 yes:)
6572 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6573 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6574 ac_tool_warned=yes ;;
6575 esac
6576 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
6577 fi
6578 else
6579 MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
6580 fi
6581
6582 test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
6583 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
6584 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
6585 if ${lt_cv_path_mainfest_tool+:} false; then :
6586 $as_echo_n "(cached) " >&6
6587 else
6588 lt_cv_path_mainfest_tool=no
6589 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
6590 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
6591 cat conftest.err >&5
6592 if $GREP 'Manifest Tool' conftest.out > /dev/null; then
6593 lt_cv_path_mainfest_tool=yes
6594 fi
6595 rm -f conftest*
6596 fi
6597 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
6598 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
6599 if test "x$lt_cv_path_mainfest_tool" != xyes; then
6600 MANIFEST_TOOL=:
6601 fi
6602
6603
6604
6605
6606
60856607
60866608 case $host_os in
60876609 rhapsody* | darwin*)
60906612 set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
60916613 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
60926614 $as_echo_n "checking for $ac_word... " >&6; }
6093 if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
6615 if ${ac_cv_prog_DSYMUTIL+:} false; then :
60946616 $as_echo_n "(cached) " >&6
60956617 else
60966618 if test -n "$DSYMUTIL"; then
61306652 set dummy dsymutil; ac_word=$2
61316653 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
61326654 $as_echo_n "checking for $ac_word... " >&6; }
6133 if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
6655 if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
61346656 $as_echo_n "(cached) " >&6
61356657 else
61366658 if test -n "$ac_ct_DSYMUTIL"; then
61826704 set dummy ${ac_tool_prefix}nmedit; ac_word=$2
61836705 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
61846706 $as_echo_n "checking for $ac_word... " >&6; }
6185 if test "${ac_cv_prog_NMEDIT+set}" = set; then :
6707 if ${ac_cv_prog_NMEDIT+:} false; then :
61866708 $as_echo_n "(cached) " >&6
61876709 else
61886710 if test -n "$NMEDIT"; then
62226744 set dummy nmedit; ac_word=$2
62236745 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
62246746 $as_echo_n "checking for $ac_word... " >&6; }
6225 if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
6747 if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
62266748 $as_echo_n "(cached) " >&6
62276749 else
62286750 if test -n "$ac_ct_NMEDIT"; then
62746796 set dummy ${ac_tool_prefix}lipo; ac_word=$2
62756797 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
62766798 $as_echo_n "checking for $ac_word... " >&6; }
6277 if test "${ac_cv_prog_LIPO+set}" = set; then :
6799 if ${ac_cv_prog_LIPO+:} false; then :
62786800 $as_echo_n "(cached) " >&6
62796801 else
62806802 if test -n "$LIPO"; then
63146836 set dummy lipo; ac_word=$2
63156837 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
63166838 $as_echo_n "checking for $ac_word... " >&6; }
6317 if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
6839 if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
63186840 $as_echo_n "(cached) " >&6
63196841 else
63206842 if test -n "$ac_ct_LIPO"; then
63666888 set dummy ${ac_tool_prefix}otool; ac_word=$2
63676889 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
63686890 $as_echo_n "checking for $ac_word... " >&6; }
6369 if test "${ac_cv_prog_OTOOL+set}" = set; then :
6891 if ${ac_cv_prog_OTOOL+:} false; then :
63706892 $as_echo_n "(cached) " >&6
63716893 else
63726894 if test -n "$OTOOL"; then
64066928 set dummy otool; ac_word=$2
64076929 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
64086930 $as_echo_n "checking for $ac_word... " >&6; }
6409 if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
6931 if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
64106932 $as_echo_n "(cached) " >&6
64116933 else
64126934 if test -n "$ac_ct_OTOOL"; then
64586980 set dummy ${ac_tool_prefix}otool64; ac_word=$2
64596981 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
64606982 $as_echo_n "checking for $ac_word... " >&6; }
6461 if test "${ac_cv_prog_OTOOL64+set}" = set; then :
6983 if ${ac_cv_prog_OTOOL64+:} false; then :
64626984 $as_echo_n "(cached) " >&6
64636985 else
64646986 if test -n "$OTOOL64"; then
64987020 set dummy otool64; ac_word=$2
64997021 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
65007022 $as_echo_n "checking for $ac_word... " >&6; }
6501 if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
7023 if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
65027024 $as_echo_n "(cached) " >&6
65037025 else
65047026 if test -n "$ac_ct_OTOOL64"; then
65737095
65747096 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
65757097 $as_echo_n "checking for -single_module linker flag... " >&6; }
6576 if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
7098 if ${lt_cv_apple_cc_single_mod+:} false; then :
65777099 $as_echo_n "(cached) " >&6
65787100 else
65797101 lt_cv_apple_cc_single_mod=no
66027124 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
66037125 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
66047126 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
6605 if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
7127 if ${lt_cv_ld_exported_symbols_list+:} false; then :
66067128 $as_echo_n "(cached) " >&6
66077129 else
66087130 lt_cv_ld_exported_symbols_list=no
66347156 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
66357157 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
66367158 $as_echo_n "checking for -force_load linker flag... " >&6; }
6637 if test "${lt_cv_ld_force_load+set}" = set; then :
7159 if ${lt_cv_ld_force_load+:} false; then :
66387160 $as_echo_n "(cached) " >&6
66397161 else
66407162 lt_cv_ld_force_load=no
67117233 CPP=
67127234 fi
67137235 if test -z "$CPP"; then
6714 if test "${ac_cv_prog_CPP+set}" = set; then :
7236 if ${ac_cv_prog_CPP+:} false; then :
67157237 $as_echo_n "(cached) " >&6
67167238 else
67177239 # Double quotes because CPP needs to be expanded
67417263 # Broken: fails on valid input.
67427264 continue
67437265 fi
6744 rm -f conftest.err conftest.$ac_ext
7266 rm -f conftest.err conftest.i conftest.$ac_ext
67457267
67467268 # OK, works on sane cases. Now check whether nonexistent headers
67477269 # can be detected and how.
67577279 ac_preproc_ok=:
67587280 break
67597281 fi
6760 rm -f conftest.err conftest.$ac_ext
7282 rm -f conftest.err conftest.i conftest.$ac_ext
67617283
67627284 done
67637285 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6764 rm -f conftest.err conftest.$ac_ext
7286 rm -f conftest.i conftest.err conftest.$ac_ext
67657287 if $ac_preproc_ok; then :
67667288 break
67677289 fi
68007322 # Broken: fails on valid input.
68017323 continue
68027324 fi
6803 rm -f conftest.err conftest.$ac_ext
7325 rm -f conftest.err conftest.i conftest.$ac_ext
68047326
68057327 # OK, works on sane cases. Now check whether nonexistent headers
68067328 # can be detected and how.
68167338 ac_preproc_ok=:
68177339 break
68187340 fi
6819 rm -f conftest.err conftest.$ac_ext
7341 rm -f conftest.err conftest.i conftest.$ac_ext
68207342
68217343 done
68227344 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6823 rm -f conftest.err conftest.$ac_ext
7345 rm -f conftest.i conftest.err conftest.$ac_ext
68247346 if $ac_preproc_ok; then :
68257347
68267348 else
68397361
68407362 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
68417363 $as_echo_n "checking for ANSI C header files... " >&6; }
6842 if test "${ac_cv_header_stdc+set}" = set; then :
7364 if ${ac_cv_header_stdc+:} false; then :
68437365 $as_echo_n "(cached) " >&6
68447366 else
68457367 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
69707492 do :
69717493 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
69727494 "
6973 if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
7495 if test "x$ac_cv_header_dlfcn_h" = xyes; then :
69747496 cat >>confdefs.h <<_ACEOF
69757497 #define HAVE_DLFCN_H 1
69767498 _ACEOF
71577679
71587680 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
71597681 $as_echo_n "checking for objdir... " >&6; }
7160 if test "${lt_cv_objdir+set}" = set; then :
7682 if ${lt_cv_objdir+:} false; then :
71617683 $as_echo_n "(cached) " >&6
71627684 else
71637685 rm -f .libs 2>/dev/null
72357757 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
72367758 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
72377759 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
7238 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
7760 if ${lt_cv_path_MAGIC_CMD+:} false; then :
72397761 $as_echo_n "(cached) " >&6
72407762 else
72417763 case $MAGIC_CMD in
73017823 if test -n "$ac_tool_prefix"; then
73027824 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
73037825 $as_echo_n "checking for file... " >&6; }
7304 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
7826 if ${lt_cv_path_MAGIC_CMD+:} false; then :
73057827 $as_echo_n "(cached) " >&6
73067828 else
73077829 case $MAGIC_CMD in
74437965
74447966 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
74457967 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
7446 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
7968 if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
74477969 $as_echo_n "(cached) " >&6
74487970 else
74497971 lt_cv_prog_compiler_rtti_exceptions=no
74968018 lt_prog_compiler_pic=
74978019 lt_prog_compiler_static=
74988020
7499 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
7500 $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
75018021
75028022 if test "$GCC" = yes; then
75038023 lt_prog_compiler_wl='-Wl,'
76618181 lt_prog_compiler_wl='-Wl,'
76628182 lt_prog_compiler_pic='--shared'
76638183 lt_prog_compiler_static='--static'
8184 ;;
8185 nagfor*)
8186 # NAG Fortran compiler
8187 lt_prog_compiler_wl='-Wl,-Wl,,'
8188 lt_prog_compiler_pic='-PIC'
8189 lt_prog_compiler_static='-Bstatic'
76648190 ;;
76658191 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
76668192 # Portland Group compilers (*not* the Pentium gcc compiler,
77818307 lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
77828308 ;;
77838309 esac
7784 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
7785 $as_echo "$lt_prog_compiler_pic" >&6; }
7786
7787
7788
7789
7790
8310
8311 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
8312 $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
8313 if ${lt_cv_prog_compiler_pic+:} false; then :
8314 $as_echo_n "(cached) " >&6
8315 else
8316 lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
8317 fi
8318 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
8319 $as_echo "$lt_cv_prog_compiler_pic" >&6; }
8320 lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
77918321
77928322 #
77938323 # Check to make sure the PIC flag actually works.
77958325 if test -n "$lt_prog_compiler_pic"; then
77968326 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
77978327 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
7798 if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
8328 if ${lt_cv_prog_compiler_pic_works+:} false; then :
77998329 $as_echo_n "(cached) " >&6
78008330 else
78018331 lt_cv_prog_compiler_pic_works=no
78488378
78498379
78508380
8381
8382
8383
8384
8385
78518386 #
78528387 # Check to make sure the static flag actually works.
78538388 #
78548389 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
78558390 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
78568391 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
7857 if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
8392 if ${lt_cv_prog_compiler_static_works+:} false; then :
78588393 $as_echo_n "(cached) " >&6
78598394 else
78608395 lt_cv_prog_compiler_static_works=no
78978432
78988433 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
78998434 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
7900 if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
8435 if ${lt_cv_prog_compiler_c_o+:} false; then :
79018436 $as_echo_n "(cached) " >&6
79028437 else
79038438 lt_cv_prog_compiler_c_o=no
79528487
79538488 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
79548489 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
7955 if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
8490 if ${lt_cv_prog_compiler_c_o+:} false; then :
79568491 $as_echo_n "(cached) " >&6
79578492 else
79588493 lt_cv_prog_compiler_c_o=no
81988733 allow_undefined_flag=unsupported
81998734 always_export_symbols=no
82008735 enable_shared_with_static_runtimes=yes
8201 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
8736 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'
8737 exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
82028738
82038739 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
82048740 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
82468782 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
82478783 && test "$tmp_diet" = no
82488784 then
8249 tmp_addflag=
8785 tmp_addflag=' $pic_flag'
82508786 tmp_sharedflag='-shared'
82518787 case $cc_basename,$host_cpu in
82528788 pgcc*) # Portland Group C compiler
83168852 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
83178853 wlarc=
83188854 else
8319 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8320 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8855 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8856 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
83218857 fi
83228858 ;;
83238859
83358871
83368872 _LT_EOF
83378873 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8338 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8339 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8874 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8875 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
83408876 else
83418877 ld_shlibs=no
83428878 fi
83828918
83838919 *)
83848920 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8385 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8386 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8921 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8922 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
83878923 else
83888924 ld_shlibs=no
83898925 fi
85139049 allow_undefined_flag='-berok'
85149050 # Determine the default libpath from the value encoded in an
85159051 # empty executable.
8516 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9052 if test "${lt_cv_aix_libpath+set}" = set; then
9053 aix_libpath=$lt_cv_aix_libpath
9054 else
9055 if ${lt_cv_aix_libpath_+:} false; then :
9056 $as_echo_n "(cached) " >&6
9057 else
9058 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
85179059 /* end confdefs.h. */
85189060
85199061 int
85269068 _ACEOF
85279069 if ac_fn_c_try_link "$LINENO"; then :
85289070
8529 lt_aix_libpath_sed='
8530 /Import File Strings/,/^$/ {
8531 /^0/ {
8532 s/^0 *\(.*\)$/\1/
8533 p
8534 }
8535 }'
8536 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8537 # Check for a 64-bit object if we didn't find anything.
8538 if test -z "$aix_libpath"; then
8539 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8540 fi
9071 lt_aix_libpath_sed='
9072 /Import File Strings/,/^$/ {
9073 /^0/ {
9074 s/^0 *\([^ ]*\) *$/\1/
9075 p
9076 }
9077 }'
9078 lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9079 # Check for a 64-bit object if we didn't find anything.
9080 if test -z "$lt_cv_aix_libpath_"; then
9081 lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9082 fi
85419083 fi
85429084 rm -f core conftest.err conftest.$ac_objext \
85439085 conftest$ac_exeext conftest.$ac_ext
8544 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
9086 if test -z "$lt_cv_aix_libpath_"; then
9087 lt_cv_aix_libpath_="/usr/lib:/lib"
9088 fi
9089
9090 fi
9091
9092 aix_libpath=$lt_cv_aix_libpath_
9093 fi
85459094
85469095 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
85479096 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
85539102 else
85549103 # Determine the default libpath from the value encoded in an
85559104 # empty executable.
8556 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9105 if test "${lt_cv_aix_libpath+set}" = set; then
9106 aix_libpath=$lt_cv_aix_libpath
9107 else
9108 if ${lt_cv_aix_libpath_+:} false; then :
9109 $as_echo_n "(cached) " >&6
9110 else
9111 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
85579112 /* end confdefs.h. */
85589113
85599114 int
85669121 _ACEOF
85679122 if ac_fn_c_try_link "$LINENO"; then :
85689123
8569 lt_aix_libpath_sed='
8570 /Import File Strings/,/^$/ {
8571 /^0/ {
8572 s/^0 *\(.*\)$/\1/
8573 p
8574 }
8575 }'
8576 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8577 # Check for a 64-bit object if we didn't find anything.
8578 if test -z "$aix_libpath"; then
8579 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8580 fi
9124 lt_aix_libpath_sed='
9125 /Import File Strings/,/^$/ {
9126 /^0/ {
9127 s/^0 *\([^ ]*\) *$/\1/
9128 p
9129 }
9130 }'
9131 lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9132 # Check for a 64-bit object if we didn't find anything.
9133 if test -z "$lt_cv_aix_libpath_"; then
9134 lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9135 fi
85819136 fi
85829137 rm -f core conftest.err conftest.$ac_objext \
85839138 conftest$ac_exeext conftest.$ac_ext
8584 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
9139 if test -z "$lt_cv_aix_libpath_"; then
9140 lt_cv_aix_libpath_="/usr/lib:/lib"
9141 fi
9142
9143 fi
9144
9145 aix_libpath=$lt_cv_aix_libpath_
9146 fi
85859147
85869148 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
85879149 # Warning - without using the other run time loading flags,
86269188 # Microsoft Visual C++.
86279189 # hardcode_libdir_flag_spec is actually meaningless, as there is
86289190 # no search path for DLLs.
8629 hardcode_libdir_flag_spec=' '
8630 allow_undefined_flag=unsupported
8631 # Tell ltmain to make .lib files, not .a files.
8632 libext=lib
8633 # Tell ltmain to make .dll files, not .so files.
8634 shrext_cmds=".dll"
8635 # FIXME: Setting linknames here is a bad hack.
8636 archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
8637 # The linker will automatically build a .lib file if we build a DLL.
8638 old_archive_from_new_cmds='true'
8639 # FIXME: Should let the user specify the lib program.
8640 old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
8641 fix_srcfile_path='`cygpath -w "$srcfile"`'
8642 enable_shared_with_static_runtimes=yes
9191 case $cc_basename in
9192 cl*)
9193 # Native MSVC
9194 hardcode_libdir_flag_spec=' '
9195 allow_undefined_flag=unsupported
9196 always_export_symbols=yes
9197 file_list_spec='@'
9198 # Tell ltmain to make .lib files, not .a files.
9199 libext=lib
9200 # Tell ltmain to make .dll files, not .so files.
9201 shrext_cmds=".dll"
9202 # FIXME: Setting linknames here is a bad hack.
9203 archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
9204 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
9205 sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
9206 else
9207 sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
9208 fi~
9209 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9210 linknames='
9211 # The linker will not automatically build a static lib if we build a DLL.
9212 # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
9213 enable_shared_with_static_runtimes=yes
9214 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
9215 # Don't use ranlib
9216 old_postinstall_cmds='chmod 644 $oldlib'
9217 postlink_cmds='lt_outputfile="@OUTPUT@"~
9218 lt_tool_outputfile="@TOOL_OUTPUT@"~
9219 case $lt_outputfile in
9220 *.exe|*.EXE) ;;
9221 *)
9222 lt_outputfile="$lt_outputfile.exe"
9223 lt_tool_outputfile="$lt_tool_outputfile.exe"
9224 ;;
9225 esac~
9226 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
9227 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9228 $RM "$lt_outputfile.manifest";
9229 fi'
9230 ;;
9231 *)
9232 # Assume MSVC wrapper
9233 hardcode_libdir_flag_spec=' '
9234 allow_undefined_flag=unsupported
9235 # Tell ltmain to make .lib files, not .a files.
9236 libext=lib
9237 # Tell ltmain to make .dll files, not .so files.
9238 shrext_cmds=".dll"
9239 # FIXME: Setting linknames here is a bad hack.
9240 archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
9241 # The linker will automatically build a .lib file if we build a DLL.
9242 old_archive_from_new_cmds='true'
9243 # FIXME: Should let the user specify the lib program.
9244 old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
9245 enable_shared_with_static_runtimes=yes
9246 ;;
9247 esac
86439248 ;;
86449249
86459250 darwin* | rhapsody*)
87049309
87059310 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
87069311 freebsd* | dragonfly*)
8707 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
9312 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
87089313 hardcode_libdir_flag_spec='-R$libdir'
87099314 hardcode_direct=yes
87109315 hardcode_shlibpath_var=no
87129317
87139318 hpux9*)
87149319 if test "$GCC" = yes; then
8715 archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
9320 archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
87169321 else
87179322 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
87189323 fi
87289333
87299334 hpux10*)
87309335 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
8731 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9336 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
87329337 else
87339338 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
87349339 fi
87529357 archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
87539358 ;;
87549359 ia64*)
8755 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9360 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
87569361 ;;
87579362 *)
8758 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9363 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
87599364 ;;
87609365 esac
87619366 else
87729377 # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
87739378 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
87749379 $as_echo_n "checking if $CC understands -b... " >&6; }
8775 if test "${lt_cv_prog_compiler__b+set}" = set; then :
9380 if ${lt_cv_prog_compiler__b+:} false; then :
87769381 $as_echo_n "(cached) " >&6
87779382 else
87789383 lt_cv_prog_compiler__b=no
88349439
88359440 irix5* | irix6* | nonstopux*)
88369441 if test "$GCC" = yes; then
8837 archive_cmds='$CC -shared $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'
9442 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'
88389443 # Try to use the -exported_symbol ld option, if it does not
88399444 # work, assume that -exports_file does not work either and
88409445 # implicitly export all symbols.
8841 save_LDFLAGS="$LDFLAGS"
8842 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
8843 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9446 # This should be the same for all languages, so no per-tag cache variable.
9447 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
9448 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
9449 if ${lt_cv_irix_exported_symbol+:} false; then :
9450 $as_echo_n "(cached) " >&6
9451 else
9452 save_LDFLAGS="$LDFLAGS"
9453 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
9454 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88449455 /* end confdefs.h. */
8845 int foo(void) {}
9456 int foo (void) { return 0; }
88469457 _ACEOF
88479458 if ac_fn_c_try_link "$LINENO"; then :
8848 archive_expsym_cmds='$CC -shared $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'
8849
9459 lt_cv_irix_exported_symbol=yes
9460 else
9461 lt_cv_irix_exported_symbol=no
88509462 fi
88519463 rm -f core conftest.err conftest.$ac_objext \
88529464 conftest$ac_exeext conftest.$ac_ext
8853 LDFLAGS="$save_LDFLAGS"
9465 LDFLAGS="$save_LDFLAGS"
9466 fi
9467 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
9468 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
9469 if test "$lt_cv_irix_exported_symbol" = yes; then
9470 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'
9471 fi
88549472 else
88559473 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'
88569474 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'
89359553 osf4* | osf5*) # as osf3* with the addition of -msym flag
89369554 if test "$GCC" = yes; then
89379555 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8938 archive_cmds='$CC -shared${allow_undefined_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'
9556 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'
89399557 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
89409558 else
89419559 allow_undefined_flag=' -expect_unresolved \*'
89549572 no_undefined_flag=' -z defs'
89559573 if test "$GCC" = yes; then
89569574 wlarc='${wl}'
8957 archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
9575 archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
89589576 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8959 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9577 $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'
89609578 else
89619579 case `$CC -V 2>&1` in
89629580 *"Compilers 5.0"*)
91449762 # to ld, don't add -lc before -lgcc.
91459763 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
91469764 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
9147 if test "${lt_cv_archive_cmds_need_lc+set}" = set; then :
9765 if ${lt_cv_archive_cmds_need_lc+:} false; then :
91489766 $as_echo_n "(cached) " >&6
91499767 else
91509768 $RM conftest*
953210150 need_version=no
953310151 need_lib_prefix=no
953410152
9535 case $GCC,$host_os in
9536 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
10153 case $GCC,$cc_basename in
10154 yes,*)
10155 # gcc
953710156 library_names_spec='$libname.dll.a'
953810157 # DLL is installed to $(libdir)/../bin by postinstall_cmds
953910158 postinstall_cmds='base_file=`basename \${file}`~
956610185 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
956710186 ;;
956810187 esac
10188 dynamic_linker='Win32 ld.exe'
956910189 ;;
957010190
10191 *,cl*)
10192 # Native MSVC
10193 libname_spec='$name'
10194 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
10195 library_names_spec='${libname}.dll.lib'
10196
10197 case $build_os in
10198 mingw*)
10199 sys_lib_search_path_spec=
10200 lt_save_ifs=$IFS
10201 IFS=';'
10202 for lt_path in $LIB
10203 do
10204 IFS=$lt_save_ifs
10205 # Let DOS variable expansion print the short 8.3 style file name.
10206 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
10207 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
10208 done
10209 IFS=$lt_save_ifs
10210 # Convert to MSYS style.
10211 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
10212 ;;
10213 cygwin*)
10214 # Convert to unix form, then to dos form, then back to unix form
10215 # but this time dos style (no spaces!) so that the unix form looks
10216 # like /cygdrive/c/PROGRA~1:/cygdr...
10217 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
10218 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
10219 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
10220 ;;
10221 *)
10222 sys_lib_search_path_spec="$LIB"
10223 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
10224 # It is most probably a Windows format PATH.
10225 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
10226 else
10227 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
10228 fi
10229 # FIXME: find the short name or the path components, as spaces are
10230 # common. (e.g. "Program Files" -> "PROGRA~1")
10231 ;;
10232 esac
10233
10234 # DLL is installed to $(libdir)/../bin by postinstall_cmds
10235 postinstall_cmds='base_file=`basename \${file}`~
10236 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
10237 dldir=$destdir/`dirname \$dlpath`~
10238 test -d \$dldir || mkdir -p \$dldir~
10239 $install_prog $dir/$dlname \$dldir/$dlname'
10240 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
10241 dlpath=$dir/\$dldll~
10242 $RM \$dlpath'
10243 shlibpath_overrides_runpath=yes
10244 dynamic_linker='Win32 link.exe'
10245 ;;
10246
957110247 *)
10248 # Assume MSVC wrapper
957210249 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
10250 dynamic_linker='Win32 ld.exe'
957310251 ;;
957410252 esac
9575 dynamic_linker='Win32 ld.exe'
957610253 # FIXME: first we should search . and the directory the executable is in
957710254 shlibpath_var=PATH
957810255 ;;
978610463 shlibpath_overrides_runpath=no
978710464
978810465 # Some binutils ld are patched to set DT_RUNPATH
9789 if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then :
10466 if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
979010467 $as_echo_n "(cached) " >&6
979110468 else
979210469 lt_cv_shlibpath_overrides_runpath=no
1021010887 # if libdl is installed we need to link against it
1021110888 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
1021210889 $as_echo_n "checking for dlopen in -ldl... " >&6; }
10213 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
10890 if ${ac_cv_lib_dl_dlopen+:} false; then :
1021410891 $as_echo_n "(cached) " >&6
1021510892 else
1021610893 ac_check_lib_save_LIBS=$LIBS
1024410921 fi
1024510922 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
1024610923 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
10247 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
10924 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
1024810925 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
1024910926 else
1025010927
1025810935
1025910936 *)
1026010937 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
10261 if test "x$ac_cv_func_shl_load" = x""yes; then :
10938 if test "x$ac_cv_func_shl_load" = xyes; then :
1026210939 lt_cv_dlopen="shl_load"
1026310940 else
1026410941 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
1026510942 $as_echo_n "checking for shl_load in -ldld... " >&6; }
10266 if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
10943 if ${ac_cv_lib_dld_shl_load+:} false; then :
1026710944 $as_echo_n "(cached) " >&6
1026810945 else
1026910946 ac_check_lib_save_LIBS=$LIBS
1029710974 fi
1029810975 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
1029910976 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
10300 if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
10977 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
1030110978 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
1030210979 else
1030310980 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
10304 if test "x$ac_cv_func_dlopen" = x""yes; then :
10981 if test "x$ac_cv_func_dlopen" = xyes; then :
1030510982 lt_cv_dlopen="dlopen"
1030610983 else
1030710984 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
1030810985 $as_echo_n "checking for dlopen in -ldl... " >&6; }
10309 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
10986 if ${ac_cv_lib_dl_dlopen+:} false; then :
1031010987 $as_echo_n "(cached) " >&6
1031110988 else
1031210989 ac_check_lib_save_LIBS=$LIBS
1034011017 fi
1034111018 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
1034211019 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
10343 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
11020 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
1034411021 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
1034511022 else
1034611023 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
1034711024 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
10348 if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
11025 if ${ac_cv_lib_svld_dlopen+:} false; then :
1034911026 $as_echo_n "(cached) " >&6
1035011027 else
1035111028 ac_check_lib_save_LIBS=$LIBS
1037911056 fi
1038011057 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
1038111058 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
10382 if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
11059 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
1038311060 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
1038411061 else
1038511062 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
1038611063 $as_echo_n "checking for dld_link in -ldld... " >&6; }
10387 if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
11064 if ${ac_cv_lib_dld_dld_link+:} false; then :
1038811065 $as_echo_n "(cached) " >&6
1038911066 else
1039011067 ac_check_lib_save_LIBS=$LIBS
1041811095 fi
1041911096 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
1042011097 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
10421 if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
11098 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
1042211099 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
1042311100 fi
1042411101
1045911136
1046011137 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
1046111138 $as_echo_n "checking whether a program can dlopen itself... " >&6; }
10462 if test "${lt_cv_dlopen_self+set}" = set; then :
11139 if ${lt_cv_dlopen_self+:} false; then :
1046311140 $as_echo_n "(cached) " >&6
1046411141 else
1046511142 if test "$cross_compiling" = yes; then :
1051211189 /* When -fvisbility=hidden is used, assume the code has been annotated
1051311190 correspondingly for the symbols needed. */
1051411191 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
10515 void fnord () __attribute__((visibility("default")));
11192 int fnord () __attribute__((visibility("default")));
1051611193 #endif
1051711194
10518 void fnord () { int i=42; }
11195 int fnord () { return 42; }
1051911196 int main ()
1052011197 {
1052111198 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1056511242 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1056611243 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
1056711244 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
10568 if test "${lt_cv_dlopen_self_static+set}" = set; then :
11245 if ${lt_cv_dlopen_self_static+:} false; then :
1056911246 $as_echo_n "(cached) " >&6
1057011247 else
1057111248 if test "$cross_compiling" = yes; then :
1061811295 /* When -fvisbility=hidden is used, assume the code has been annotated
1061911296 correspondingly for the symbols needed. */
1062011297 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
10621 void fnord () __attribute__((visibility("default")));
11298 int fnord () __attribute__((visibility("default")));
1062211299 #endif
1062311300
10624 void fnord () { int i=42; }
11301 int fnord () { return 42; }
1062511302 int main ()
1062611303 {
1062711304 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1097011647 set dummy intltool-update; ac_word=$2
1097111648 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1097211649 $as_echo_n "checking for $ac_word... " >&6; }
10973 if test "${ac_cv_path_INTLTOOL_UPDATE+set}" = set; then :
11650 if ${ac_cv_path_INTLTOOL_UPDATE+:} false; then :
1097411651 $as_echo_n "(cached) " >&6
1097511652 else
1097611653 case $INTLTOOL_UPDATE in
1101011687 set dummy intltool-merge; ac_word=$2
1101111688 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1101211689 $as_echo_n "checking for $ac_word... " >&6; }
11013 if test "${ac_cv_path_INTLTOOL_MERGE+set}" = set; then :
11690 if ${ac_cv_path_INTLTOOL_MERGE+:} false; then :
1101411691 $as_echo_n "(cached) " >&6
1101511692 else
1101611693 case $INTLTOOL_MERGE in
1105011727 set dummy intltool-extract; ac_word=$2
1105111728 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1105211729 $as_echo_n "checking for $ac_word... " >&6; }
11053 if test "${ac_cv_path_INTLTOOL_EXTRACT+set}" = set; then :
11730 if ${ac_cv_path_INTLTOOL_EXTRACT+:} false; then :
1105411731 $as_echo_n "(cached) " >&6
1105511732 else
1105611733 case $INTLTOOL_EXTRACT in
1121111888 set dummy xgettext; ac_word=$2
1121211889 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1121311890 $as_echo_n "checking for $ac_word... " >&6; }
11214 if test "${ac_cv_path_XGETTEXT+set}" = set; then :
11891 if ${ac_cv_path_XGETTEXT+:} false; then :
1121511892 $as_echo_n "(cached) " >&6
1121611893 else
1121711894 case $XGETTEXT in
1125111928 set dummy msgmerge; ac_word=$2
1125211929 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1125311930 $as_echo_n "checking for $ac_word... " >&6; }
11254 if test "${ac_cv_path_MSGMERGE+set}" = set; then :
11931 if ${ac_cv_path_MSGMERGE+:} false; then :
1125511932 $as_echo_n "(cached) " >&6
1125611933 else
1125711934 case $MSGMERGE in
1129111968 set dummy msgfmt; ac_word=$2
1129211969 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1129311970 $as_echo_n "checking for $ac_word... " >&6; }
11294 if test "${ac_cv_path_MSGFMT+set}" = set; then :
11971 if ${ac_cv_path_MSGFMT+:} false; then :
1129511972 $as_echo_n "(cached) " >&6
1129611973 else
1129711974 case $MSGFMT in
1133112008 set dummy gmsgfmt; ac_word=$2
1133212009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1133312010 $as_echo_n "checking for $ac_word... " >&6; }
11334 if test "${ac_cv_path_GMSGFMT+set}" = set; then :
12011 if ${ac_cv_path_GMSGFMT+:} false; then :
1133512012 $as_echo_n "(cached) " >&6
1133612013 else
1133712014 case $GMSGFMT in
1138212059 set dummy perl; ac_word=$2
1138312060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1138412061 $as_echo_n "checking for $ac_word... " >&6; }
11385 if test "${ac_cv_path_INTLTOOL_PERL+set}" = set; then :
12062 if ${ac_cv_path_INTLTOOL_PERL+:} false; then :
1138612063 $as_echo_n "(cached) " >&6
1138712064 else
1138812065 case $INTLTOOL_PERL in
1146612143 case $host in
1146712144 *-*-solaris*)
1146812145 ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
11469 if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then :
12146 if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
1147012147 DATADIRNAME=share
1147112148 else
1147212149 DATADIRNAME=lib
1149012167 for ac_header in locale.h
1149112168 do :
1149212169 ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default"
11493 if test "x$ac_cv_header_locale_h" = x""yes; then :
12170 if test "x$ac_cv_header_locale_h" = xyes; then :
1149412171 cat >>confdefs.h <<_ACEOF
1149512172 #define HAVE_LOCALE_H 1
1149612173 _ACEOF
1150212179 if test $ac_cv_header_locale_h = yes; then
1150312180 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
1150412181 $as_echo_n "checking for LC_MESSAGES... " >&6; }
11505 if test "${am_cv_val_LC_MESSAGES+set}" = set; then :
12182 if ${am_cv_val_LC_MESSAGES+:} false; then :
1150612183 $as_echo_n "(cached) " >&6
1150712184 else
1150812185 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1154212219 INTLLIBS=
1154312220
1154412221 ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
11545 if test "x$ac_cv_header_libintl_h" = x""yes; then :
12222 if test "x$ac_cv_header_libintl_h" = xyes; then :
1154612223 gt_cv_func_dgettext_libintl="no"
1154712224 libintl_extra_libs=""
1154812225
1155112228 #
1155212229 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5
1155312230 $as_echo_n "checking for ngettext in libc... " >&6; }
11554 if test "${gt_cv_func_ngettext_libc+set}" = set; then :
12231 if ${gt_cv_func_ngettext_libc+:} false; then :
1155512232 $as_echo_n "(cached) " >&6
1155612233 else
1155712234 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1158212259 if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1158312260 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5
1158412261 $as_echo_n "checking for dgettext in libc... " >&6; }
11585 if test "${gt_cv_func_dgettext_libc+set}" = set; then :
12262 if ${gt_cv_func_dgettext_libc+:} false; then :
1158612263 $as_echo_n "(cached) " >&6
1158712264 else
1158812265 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1161512292 for ac_func in bind_textdomain_codeset
1161612293 do :
1161712294 ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
11618 if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then :
12295 if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
1161912296 cat >>confdefs.h <<_ACEOF
1162012297 #define HAVE_BIND_TEXTDOMAIN_CODESET 1
1162112298 _ACEOF
1163412311
1163512312 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5
1163612313 $as_echo_n "checking for bindtextdomain in -lintl... " >&6; }
11637 if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then :
12314 if ${ac_cv_lib_intl_bindtextdomain+:} false; then :
1163812315 $as_echo_n "(cached) " >&6
1163912316 else
1164012317 ac_check_lib_save_LIBS=$LIBS
1166812345 fi
1166912346 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5
1167012347 $as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; }
11671 if test "x$ac_cv_lib_intl_bindtextdomain" = x""yes; then :
12348 if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then :
1167212349 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5
1167312350 $as_echo_n "checking for ngettext in -lintl... " >&6; }
11674 if test "${ac_cv_lib_intl_ngettext+set}" = set; then :
12351 if ${ac_cv_lib_intl_ngettext+:} false; then :
1167512352 $as_echo_n "(cached) " >&6
1167612353 else
1167712354 ac_check_lib_save_LIBS=$LIBS
1170512382 fi
1170612383 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5
1170712384 $as_echo "$ac_cv_lib_intl_ngettext" >&6; }
11708 if test "x$ac_cv_lib_intl_ngettext" = x""yes; then :
12385 if test "x$ac_cv_lib_intl_ngettext" = xyes; then :
1170912386 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5
1171012387 $as_echo_n "checking for dgettext in -lintl... " >&6; }
11711 if test "${ac_cv_lib_intl_dgettext+set}" = set; then :
12388 if ${ac_cv_lib_intl_dgettext+:} false; then :
1171212389 $as_echo_n "(cached) " >&6
1171312390 else
1171412391 ac_check_lib_save_LIBS=$LIBS
1174212419 fi
1174312420 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5
1174412421 $as_echo "$ac_cv_lib_intl_dgettext" >&6; }
11745 if test "x$ac_cv_lib_intl_dgettext" = x""yes; then :
12422 if test "x$ac_cv_lib_intl_dgettext" = xyes; then :
1174612423 gt_cv_func_dgettext_libintl=yes
1174712424 fi
1174812425
1175812435 $as_echo "" >&6; }
1175912436 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5
1176012437 $as_echo_n "checking for ngettext in -lintl... " >&6; }
11761 if test "${ac_cv_lib_intl_ngettext+set}" = set; then :
12438 if ${ac_cv_lib_intl_ngettext+:} false; then :
1176212439 $as_echo_n "(cached) " >&6
1176312440 else
1176412441 ac_check_lib_save_LIBS=$LIBS
1179212469 fi
1179312470 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5
1179412471 $as_echo "$ac_cv_lib_intl_ngettext" >&6; }
11795 if test "x$ac_cv_lib_intl_ngettext" = x""yes; then :
12472 if test "x$ac_cv_lib_intl_ngettext" = xyes; then :
1179612473 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5
1179712474 $as_echo_n "checking for dcgettext in -lintl... " >&6; }
11798 if test "${ac_cv_lib_intl_dcgettext+set}" = set; then :
12475 if ${ac_cv_lib_intl_dcgettext+:} false; then :
1179912476 $as_echo_n "(cached) " >&6
1180012477 else
1180112478 ac_check_lib_save_LIBS=$LIBS
1182912506 fi
1183012507 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5
1183112508 $as_echo "$ac_cv_lib_intl_dcgettext" >&6; }
11832 if test "x$ac_cv_lib_intl_dcgettext" = x""yes; then :
12509 if test "x$ac_cv_lib_intl_dcgettext" = xyes; then :
1183312510 gt_cv_func_dgettext_libintl=yes
1183412511 libintl_extra_libs=-liconv
1183512512 else
1185412531 for ac_func in bind_textdomain_codeset
1185512532 do :
1185612533 ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
11857 if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then :
12534 if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
1185812535 cat >>confdefs.h <<_ACEOF
1185912536 #define HAVE_BIND_TEXTDOMAIN_CODESET 1
1186012537 _ACEOF
1189212569 set dummy msgfmt; ac_word=$2
1189312570 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1189412571 $as_echo_n "checking for $ac_word... " >&6; }
11895 if test "${ac_cv_path_MSGFMT+set}" = set; then :
12572 if ${ac_cv_path_MSGFMT+:} false; then :
1189612573 $as_echo_n "(cached) " >&6
1189712574 else
1189812575 case "$MSGFMT" in
1192912606 for ac_func in dcgettext
1193012607 do :
1193112608 ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext"
11932 if test "x$ac_cv_func_dcgettext" = x""yes; then :
12609 if test "x$ac_cv_func_dcgettext" = xyes; then :
1193312610 cat >>confdefs.h <<_ACEOF
1193412611 #define HAVE_DCGETTEXT 1
1193512612 _ACEOF
1197012647 set dummy gmsgfmt; ac_word=$2
1197112648 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1197212649 $as_echo_n "checking for $ac_word... " >&6; }
11973 if test "${ac_cv_path_GMSGFMT+set}" = set; then :
12650 if ${ac_cv_path_GMSGFMT+:} false; then :
1197412651 $as_echo_n "(cached) " >&6
1197512652 else
1197612653 case $GMSGFMT in
1201112688 set dummy xgettext; ac_word=$2
1201212689 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1201312690 $as_echo_n "checking for $ac_word... " >&6; }
12014 if test "${ac_cv_path_XGETTEXT+set}" = set; then :
12691 if ${ac_cv_path_XGETTEXT+:} false; then :
1201512692 $as_echo_n "(cached) " >&6
1201612693 else
1201712694 case "$XGETTEXT" in
1206212739 case $host in
1206312740 *-*-solaris*)
1206412741 ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
12065 if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then :
12742 if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
1206612743 CATOBJEXT=.gmo
1206712744 DATADIRNAME=share
1206812745 else
1220412881 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
1220512882 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1220612883 $as_echo_n "checking for $ac_word... " >&6; }
12207 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
12884 if ${ac_cv_path_PKG_CONFIG+:} false; then :
1220812885 $as_echo_n "(cached) " >&6
1220912886 else
1221012887 case $PKG_CONFIG in
1224712924 set dummy pkg-config; ac_word=$2
1224812925 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1224912926 $as_echo_n "checking for $ac_word... " >&6; }
12250 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
12927 if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
1225112928 $as_echo_n "(cached) " >&6
1225212929 else
1225312930 case $ac_pt_PKG_CONFIG in
1231312990 fi
1231412991
1231512992 pkg_failed=no
12316 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML2" >&5
12317 $as_echo_n "checking for LIBXML2... " >&6; }
12318
12319 if test -n "$LIBXML2_CFLAGS"; then
12320 pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS"
12993 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB2" >&5
12994 $as_echo_n "checking for GLIB2... " >&6; }
12995
12996 if test -n "$GLIB2_CFLAGS"; then
12997 pkg_cv_GLIB2_CFLAGS="$GLIB2_CFLAGS"
1232112998 elif test -n "$PKG_CONFIG"; then
1232212999 if test -n "$PKG_CONFIG" && \
12323 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6.0\""; } >&5
12324 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6.0") 2>&5
13000 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-export-2.0 >= \$GLIB2_REQUIRED\""; } >&5
13001 ($PKG_CONFIG --exists --print-errors "gmodule-export-2.0 >= $GLIB2_REQUIRED") 2>&5
1232513002 ac_status=$?
1232613003 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1232713004 test $ac_status = 0; }; then
12328 pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.6.0" 2>/dev/null`
13005 pkg_cv_GLIB2_CFLAGS=`$PKG_CONFIG --cflags "gmodule-export-2.0 >= $GLIB2_REQUIRED" 2>/dev/null`
1232913006 else
1233013007 pkg_failed=yes
1233113008 fi
1233213009 else
1233313010 pkg_failed=untried
1233413011 fi
12335 if test -n "$LIBXML2_LIBS"; then
12336 pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS"
13012 if test -n "$GLIB2_LIBS"; then
13013 pkg_cv_GLIB2_LIBS="$GLIB2_LIBS"
1233713014 elif test -n "$PKG_CONFIG"; then
1233813015 if test -n "$PKG_CONFIG" && \
12339 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6.0\""; } >&5
12340 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6.0") 2>&5
13016 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-export-2.0 >= \$GLIB2_REQUIRED\""; } >&5
13017 ($PKG_CONFIG --exists --print-errors "gmodule-export-2.0 >= $GLIB2_REQUIRED") 2>&5
1234113018 ac_status=$?
1234213019 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1234313020 test $ac_status = 0; }; then
12344 pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.6.0" 2>/dev/null`
13021 pkg_cv_GLIB2_LIBS=`$PKG_CONFIG --libs "gmodule-export-2.0 >= $GLIB2_REQUIRED" 2>/dev/null`
1234513022 else
1234613023 pkg_failed=yes
1234713024 fi
1236113038 _pkg_short_errors_supported=no
1236213039 fi
1236313040 if test $_pkg_short_errors_supported = yes; then
12364 LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libxml-2.0 >= 2.6.0" 2>&1`
13041 GLIB2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gmodule-export-2.0 >= $GLIB2_REQUIRED" 2>&1`
1236513042 else
12366 LIBXML2_PKG_ERRORS=`$PKG_CONFIG --print-errors "libxml-2.0 >= 2.6.0" 2>&1`
13043 GLIB2_PKG_ERRORS=`$PKG_CONFIG --print-errors "gmodule-export-2.0 >= $GLIB2_REQUIRED" 2>&1`
1236713044 fi
1236813045 # Put the nasty error message in config.log where it belongs
12369 echo "$LIBXML2_PKG_ERRORS" >&5
12370
12371 as_fn_error $? "Package requirements (libxml-2.0 >= 2.6.0) were not met:
12372
12373 $LIBXML2_PKG_ERRORS
13046 echo "$GLIB2_PKG_ERRORS" >&5
13047
13048 as_fn_error $? "Package requirements (gmodule-export-2.0 >= $GLIB2_REQUIRED) were not met:
13049
13050 $GLIB2_PKG_ERRORS
1237413051
1237513052 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1237613053 installed software in a non-standard prefix.
1237713054
12378 Alternatively, you may set the environment variables LIBXML2_CFLAGS
12379 and LIBXML2_LIBS to avoid the need to call pkg-config.
13055 Alternatively, you may set the environment variables GLIB2_CFLAGS
13056 and GLIB2_LIBS to avoid the need to call pkg-config.
1238013057 See the pkg-config man page for more details." "$LINENO" 5
1238113058
1238213059 elif test $pkg_failed = untried; then
1238813065 is in your PATH or set the PKG_CONFIG environment variable to the full
1238913066 path to pkg-config.
1239013067
12391 Alternatively, you may set the environment variables LIBXML2_CFLAGS
12392 and LIBXML2_LIBS to avoid the need to call pkg-config.
13068 Alternatively, you may set the environment variables GLIB2_CFLAGS
13069 and GLIB2_LIBS to avoid the need to call pkg-config.
1239313070 See the pkg-config man page for more details.
1239413071
1239513072 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
1239613073 See \`config.log' for more details" "$LINENO" 5; }
1239713074
1239813075 else
12399 LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS
12400 LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS
13076 GLIB2_CFLAGS=$pkg_cv_GLIB2_CFLAGS
13077 GLIB2_LIBS=$pkg_cv_GLIB2_LIBS
1240113078 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1240213079 $as_echo "yes" >&6; }
1240313080
1240413081 fi
1240513082
1240613083 pkg_failed=no
12407 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVIRT" >&5
12408 $as_echo_n "checking for LIBVIRT... " >&6; }
12409
12410 if test -n "$LIBVIRT_CFLAGS"; then
12411 pkg_cv_LIBVIRT_CFLAGS="$LIBVIRT_CFLAGS"
13084 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML2" >&5
13085 $as_echo_n "checking for LIBXML2... " >&6; }
13086
13087 if test -n "$LIBXML2_CFLAGS"; then
13088 pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS"
1241213089 elif test -n "$PKG_CONFIG"; then
1241313090 if test -n "$PKG_CONFIG" && \
12414 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt >= 0.6.0\""; } >&5
12415 ($PKG_CONFIG --exists --print-errors "libvirt >= 0.6.0") 2>&5
13091 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= \$LIBXML2_REQUIRED\""; } >&5
13092 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= $LIBXML2_REQUIRED") 2>&5
1241613093 ac_status=$?
1241713094 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1241813095 test $ac_status = 0; }; then
12419 pkg_cv_LIBVIRT_CFLAGS=`$PKG_CONFIG --cflags "libvirt >= 0.6.0" 2>/dev/null`
13096 pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= $LIBXML2_REQUIRED" 2>/dev/null`
1242013097 else
1242113098 pkg_failed=yes
1242213099 fi
1242313100 else
1242413101 pkg_failed=untried
1242513102 fi
12426 if test -n "$LIBVIRT_LIBS"; then
12427 pkg_cv_LIBVIRT_LIBS="$LIBVIRT_LIBS"
13103 if test -n "$LIBXML2_LIBS"; then
13104 pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS"
1242813105 elif test -n "$PKG_CONFIG"; then
1242913106 if test -n "$PKG_CONFIG" && \
12430 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt >= 0.6.0\""; } >&5
12431 ($PKG_CONFIG --exists --print-errors "libvirt >= 0.6.0") 2>&5
13107 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= \$LIBXML2_REQUIRED\""; } >&5
13108 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= $LIBXML2_REQUIRED") 2>&5
1243213109 ac_status=$?
1243313110 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1243413111 test $ac_status = 0; }; then
12435 pkg_cv_LIBVIRT_LIBS=`$PKG_CONFIG --libs "libvirt >= 0.6.0" 2>/dev/null`
13112 pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= $LIBXML2_REQUIRED" 2>/dev/null`
1243613113 else
1243713114 pkg_failed=yes
1243813115 fi
1245213129 _pkg_short_errors_supported=no
1245313130 fi
1245413131 if test $_pkg_short_errors_supported = yes; then
12455 LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libvirt >= 0.6.0" 2>&1`
13132 LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libxml-2.0 >= $LIBXML2_REQUIRED" 2>&1`
1245613133 else
12457 LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --print-errors "libvirt >= 0.6.0" 2>&1`
13134 LIBXML2_PKG_ERRORS=`$PKG_CONFIG --print-errors "libxml-2.0 >= $LIBXML2_REQUIRED" 2>&1`
1245813135 fi
1245913136 # Put the nasty error message in config.log where it belongs
12460 echo "$LIBVIRT_PKG_ERRORS" >&5
12461
12462 as_fn_error $? "Package requirements (libvirt >= 0.6.0) were not met:
12463
12464 $LIBVIRT_PKG_ERRORS
13137 echo "$LIBXML2_PKG_ERRORS" >&5
13138
13139 as_fn_error $? "Package requirements (libxml-2.0 >= $LIBXML2_REQUIRED) were not met:
13140
13141 $LIBXML2_PKG_ERRORS
1246513142
1246613143 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1246713144 installed software in a non-standard prefix.
1246813145
12469 Alternatively, you may set the environment variables LIBVIRT_CFLAGS
12470 and LIBVIRT_LIBS to avoid the need to call pkg-config.
13146 Alternatively, you may set the environment variables LIBXML2_CFLAGS
13147 and LIBXML2_LIBS to avoid the need to call pkg-config.
1247113148 See the pkg-config man page for more details." "$LINENO" 5
1247213149
1247313150 elif test $pkg_failed = untried; then
1247913156 is in your PATH or set the PKG_CONFIG environment variable to the full
1248013157 path to pkg-config.
1248113158
12482 Alternatively, you may set the environment variables LIBVIRT_CFLAGS
12483 and LIBVIRT_LIBS to avoid the need to call pkg-config.
13159 Alternatively, you may set the environment variables LIBXML2_CFLAGS
13160 and LIBXML2_LIBS to avoid the need to call pkg-config.
1248413161 See the pkg-config man page for more details.
1248513162
1248613163 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
1248713164 See \`config.log' for more details" "$LINENO" 5; }
1248813165
1248913166 else
12490 LIBVIRT_CFLAGS=$pkg_cv_LIBVIRT_CFLAGS
12491 LIBVIRT_LIBS=$pkg_cv_LIBVIRT_LIBS
13167 LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS
13168 LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS
1249213169 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1249313170 $as_echo "yes" >&6; }
1249413171
1249513172 fi
1249613173
1249713174 pkg_failed=no
12498 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK2" >&5
12499 $as_echo_n "checking for GTK2... " >&6; }
12500
12501 if test -n "$GTK2_CFLAGS"; then
12502 pkg_cv_GTK2_CFLAGS="$GTK2_CFLAGS"
13175 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVIRT" >&5
13176 $as_echo_n "checking for LIBVIRT... " >&6; }
13177
13178 if test -n "$LIBVIRT_CFLAGS"; then
13179 pkg_cv_LIBVIRT_CFLAGS="$LIBVIRT_CFLAGS"
1250313180 elif test -n "$PKG_CONFIG"; then
1250413181 if test -n "$PKG_CONFIG" && \
12505 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.10.0\""; } >&5
12506 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.10.0") 2>&5
13182 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt >= \$LIBVIRT_REQUIRED\""; } >&5
13183 ($PKG_CONFIG --exists --print-errors "libvirt >= $LIBVIRT_REQUIRED") 2>&5
1250713184 ac_status=$?
1250813185 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1250913186 test $ac_status = 0; }; then
12510 pkg_cv_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.10.0" 2>/dev/null`
13187 pkg_cv_LIBVIRT_CFLAGS=`$PKG_CONFIG --cflags "libvirt >= $LIBVIRT_REQUIRED" 2>/dev/null`
1251113188 else
1251213189 pkg_failed=yes
1251313190 fi
1251413191 else
1251513192 pkg_failed=untried
1251613193 fi
12517 if test -n "$GTK2_LIBS"; then
12518 pkg_cv_GTK2_LIBS="$GTK2_LIBS"
13194 if test -n "$LIBVIRT_LIBS"; then
13195 pkg_cv_LIBVIRT_LIBS="$LIBVIRT_LIBS"
1251913196 elif test -n "$PKG_CONFIG"; then
1252013197 if test -n "$PKG_CONFIG" && \
12521 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.10.0\""; } >&5
12522 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.10.0") 2>&5
13198 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libvirt >= \$LIBVIRT_REQUIRED\""; } >&5
13199 ($PKG_CONFIG --exists --print-errors "libvirt >= $LIBVIRT_REQUIRED") 2>&5
1252313200 ac_status=$?
1252413201 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1252513202 test $ac_status = 0; }; then
12526 pkg_cv_GTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.10.0" 2>/dev/null`
13203 pkg_cv_LIBVIRT_LIBS=`$PKG_CONFIG --libs "libvirt >= $LIBVIRT_REQUIRED" 2>/dev/null`
1252713204 else
1252813205 pkg_failed=yes
1252913206 fi
1254313220 _pkg_short_errors_supported=no
1254413221 fi
1254513222 if test $_pkg_short_errors_supported = yes; then
12546 GTK2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk+-2.0 >= 2.10.0" 2>&1`
13223 LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libvirt >= $LIBVIRT_REQUIRED" 2>&1`
1254713224 else
12548 GTK2_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk+-2.0 >= 2.10.0" 2>&1`
13225 LIBVIRT_PKG_ERRORS=`$PKG_CONFIG --print-errors "libvirt >= $LIBVIRT_REQUIRED" 2>&1`
1254913226 fi
1255013227 # Put the nasty error message in config.log where it belongs
12551 echo "$GTK2_PKG_ERRORS" >&5
12552
12553 as_fn_error $? "Package requirements (gtk+-2.0 >= 2.10.0) were not met:
12554
12555 $GTK2_PKG_ERRORS
13228 echo "$LIBVIRT_PKG_ERRORS" >&5
13229
13230 as_fn_error $? "Package requirements (libvirt >= $LIBVIRT_REQUIRED) were not met:
13231
13232 $LIBVIRT_PKG_ERRORS
1255613233
1255713234 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1255813235 installed software in a non-standard prefix.
1255913236
12560 Alternatively, you may set the environment variables GTK2_CFLAGS
12561 and GTK2_LIBS to avoid the need to call pkg-config.
13237 Alternatively, you may set the environment variables LIBVIRT_CFLAGS
13238 and LIBVIRT_LIBS to avoid the need to call pkg-config.
1256213239 See the pkg-config man page for more details." "$LINENO" 5
1256313240
1256413241 elif test $pkg_failed = untried; then
1257013247 is in your PATH or set the PKG_CONFIG environment variable to the full
1257113248 path to pkg-config.
1257213249
12573 Alternatively, you may set the environment variables GTK2_CFLAGS
12574 and GTK2_LIBS to avoid the need to call pkg-config.
13250 Alternatively, you may set the environment variables LIBVIRT_CFLAGS
13251 and LIBVIRT_LIBS to avoid the need to call pkg-config.
1257513252 See the pkg-config man page for more details.
1257613253
1257713254 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
1257813255 See \`config.log' for more details" "$LINENO" 5; }
1257913256
1258013257 else
12581 GTK2_CFLAGS=$pkg_cv_GTK2_CFLAGS
12582 GTK2_LIBS=$pkg_cv_GTK2_LIBS
13258 LIBVIRT_CFLAGS=$pkg_cv_LIBVIRT_CFLAGS
13259 LIBVIRT_LIBS=$pkg_cv_LIBVIRT_LIBS
1258313260 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1258413261 $as_echo "yes" >&6; }
1258513262
1258613263 fi
1258713264
13265 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which gtk+ version to compile against" >&5
13266 $as_echo_n "checking which gtk+ version to compile against... " >&6; }
13267
13268 # Check whether --with-gtk was given.
13269 if test "${with_gtk+set}" = set; then :
13270 withval=$with_gtk; case "$with_gtk" in
13271 2.0|3.0) ;;
13272 *) as_fn_error $? "invalid gtk version specified" "$LINENO" 5 ;;
13273 esac
13274 else
13275 with_gtk=2.0
13276 fi
13277
13278 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gtk" >&5
13279 $as_echo "$with_gtk" >&6; }
13280
13281 case "$with_gtk" in
13282 2.0) GTK_API_VERSION=2.0
13283 GTK_REQUIRED=$GTK2_REQUIRED
13284 GTK_VNC_API_VERSION=1.0
13285 SPICE_GTK_API_VERSION=2.0
13286 ;;
13287 3.0) GTK_API_VERSION=3.0
13288 GTK_REQUIRED=$GTK3_REQUIRED
13289 GTK_VNC_API_VERSION=2.0
13290 SPICE_GTK_API_VERSION=3.0
13291 ;;
13292 esac
13293
13294
13295
13296
13297 if test "$with_gtk" = "2.0"; then
13298 HAVE_GTK_2_TRUE=
13299 HAVE_GTK_2_FALSE='#'
13300 else
13301 HAVE_GTK_2_TRUE='#'
13302 HAVE_GTK_2_FALSE=
13303 fi
13304
13305 if test "$with_gtk" = "3.0"; then
13306 HAVE_GTK_3_TRUE=
13307 HAVE_GTK_3_FALSE='#'
13308 else
13309 HAVE_GTK_3_TRUE='#'
13310 HAVE_GTK_3_FALSE=
13311 fi
13312
13313
13314
1258813315 pkg_failed=no
12589 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBGLADE2" >&5
12590 $as_echo_n "checking for LIBGLADE2... " >&6; }
12591
12592 if test -n "$LIBGLADE2_CFLAGS"; then
12593 pkg_cv_LIBGLADE2_CFLAGS="$LIBGLADE2_CFLAGS"
13316 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK" >&5
13317 $as_echo_n "checking for GTK... " >&6; }
13318
13319 if test -n "$GTK_CFLAGS"; then
13320 pkg_cv_GTK_CFLAGS="$GTK_CFLAGS"
1259413321 elif test -n "$PKG_CONFIG"; then
1259513322 if test -n "$PKG_CONFIG" && \
12596 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libglade-2.0 >= 2.6.0\""; } >&5
12597 ($PKG_CONFIG --exists --print-errors "libglade-2.0 >= 2.6.0") 2>&5
13323 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-\$GTK_API_VERSION >= \$GTK_REQUIRED\""; } >&5
13324 ($PKG_CONFIG --exists --print-errors "gtk+-$GTK_API_VERSION >= $GTK_REQUIRED") 2>&5
1259813325 ac_status=$?
1259913326 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1260013327 test $ac_status = 0; }; then
12601 pkg_cv_LIBGLADE2_CFLAGS=`$PKG_CONFIG --cflags "libglade-2.0 >= 2.6.0" 2>/dev/null`
13328 pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-$GTK_API_VERSION >= $GTK_REQUIRED" 2>/dev/null`
1260213329 else
1260313330 pkg_failed=yes
1260413331 fi
1260513332 else
1260613333 pkg_failed=untried
1260713334 fi
12608 if test -n "$LIBGLADE2_LIBS"; then
12609 pkg_cv_LIBGLADE2_LIBS="$LIBGLADE2_LIBS"
13335 if test -n "$GTK_LIBS"; then
13336 pkg_cv_GTK_LIBS="$GTK_LIBS"
1261013337 elif test -n "$PKG_CONFIG"; then
1261113338 if test -n "$PKG_CONFIG" && \
12612 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libglade-2.0 >= 2.6.0\""; } >&5
12613 ($PKG_CONFIG --exists --print-errors "libglade-2.0 >= 2.6.0") 2>&5
13339 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-\$GTK_API_VERSION >= \$GTK_REQUIRED\""; } >&5
13340 ($PKG_CONFIG --exists --print-errors "gtk+-$GTK_API_VERSION >= $GTK_REQUIRED") 2>&5
1261413341 ac_status=$?
1261513342 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1261613343 test $ac_status = 0; }; then
12617 pkg_cv_LIBGLADE2_LIBS=`$PKG_CONFIG --libs "libglade-2.0 >= 2.6.0" 2>/dev/null`
13344 pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-$GTK_API_VERSION >= $GTK_REQUIRED" 2>/dev/null`
1261813345 else
1261913346 pkg_failed=yes
1262013347 fi
1263413361 _pkg_short_errors_supported=no
1263513362 fi
1263613363 if test $_pkg_short_errors_supported = yes; then
12637 LIBGLADE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libglade-2.0 >= 2.6.0" 2>&1`
13364 GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk+-$GTK_API_VERSION >= $GTK_REQUIRED" 2>&1`
1263813365 else
12639 LIBGLADE2_PKG_ERRORS=`$PKG_CONFIG --print-errors "libglade-2.0 >= 2.6.0" 2>&1`
13366 GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk+-$GTK_API_VERSION >= $GTK_REQUIRED" 2>&1`
1264013367 fi
1264113368 # Put the nasty error message in config.log where it belongs
12642 echo "$LIBGLADE2_PKG_ERRORS" >&5
12643
12644 as_fn_error $? "Package requirements (libglade-2.0 >= 2.6.0) were not met:
12645
12646 $LIBGLADE2_PKG_ERRORS
13369 echo "$GTK_PKG_ERRORS" >&5
13370
13371 as_fn_error $? "Package requirements (gtk+-$GTK_API_VERSION >= $GTK_REQUIRED) were not met:
13372
13373 $GTK_PKG_ERRORS
1264713374
1264813375 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1264913376 installed software in a non-standard prefix.
1265013377
12651 Alternatively, you may set the environment variables LIBGLADE2_CFLAGS
12652 and LIBGLADE2_LIBS to avoid the need to call pkg-config.
13378 Alternatively, you may set the environment variables GTK_CFLAGS
13379 and GTK_LIBS to avoid the need to call pkg-config.
1265313380 See the pkg-config man page for more details." "$LINENO" 5
1265413381
1265513382 elif test $pkg_failed = untried; then
1266113388 is in your PATH or set the PKG_CONFIG environment variable to the full
1266213389 path to pkg-config.
1266313390
12664 Alternatively, you may set the environment variables LIBGLADE2_CFLAGS
12665 and LIBGLADE2_LIBS to avoid the need to call pkg-config.
13391 Alternatively, you may set the environment variables GTK_CFLAGS
13392 and GTK_LIBS to avoid the need to call pkg-config.
1266613393 See the pkg-config man page for more details.
1266713394
1266813395 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
1266913396 See \`config.log' for more details" "$LINENO" 5; }
1267013397
1267113398 else
12672 LIBGLADE2_CFLAGS=$pkg_cv_LIBGLADE2_CFLAGS
12673 LIBGLADE2_LIBS=$pkg_cv_LIBGLADE2_LIBS
13399 GTK_CFLAGS=$pkg_cv_GTK_CFLAGS
13400 GTK_LIBS=$pkg_cv_GTK_LIBS
1267413401 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1267513402 $as_echo "yes" >&6; }
1267613403
1267713404 fi
1267813405
13406
1267913407 pkg_failed=no
12680 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKVNC" >&5
12681 $as_echo_n "checking for GTKVNC... " >&6; }
12682
12683 if test -n "$GTKVNC_CFLAGS"; then
12684 pkg_cv_GTKVNC_CFLAGS="$GTKVNC_CFLAGS"
13408 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK_VNC" >&5
13409 $as_echo_n "checking for GTK_VNC... " >&6; }
13410
13411 if test -n "$GTK_VNC_CFLAGS"; then
13412 pkg_cv_GTK_VNC_CFLAGS="$GTK_VNC_CFLAGS"
1268513413 elif test -n "$PKG_CONFIG"; then
1268613414 if test -n "$PKG_CONFIG" && \
12687 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-vnc-1.0 >= 0.3.8\""; } >&5
12688 ($PKG_CONFIG --exists --print-errors "gtk-vnc-1.0 >= 0.3.8") 2>&5
13415 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-vnc-\$GTK_VNC_API_VERSION >= \$GTK_VNC_REQUIRED\""; } >&5
13416 ($PKG_CONFIG --exists --print-errors "gtk-vnc-$GTK_VNC_API_VERSION >= $GTK_VNC_REQUIRED") 2>&5
1268913417 ac_status=$?
1269013418 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1269113419 test $ac_status = 0; }; then
12692 pkg_cv_GTKVNC_CFLAGS=`$PKG_CONFIG --cflags "gtk-vnc-1.0 >= 0.3.8" 2>/dev/null`
13420 pkg_cv_GTK_VNC_CFLAGS=`$PKG_CONFIG --cflags "gtk-vnc-$GTK_VNC_API_VERSION >= $GTK_VNC_REQUIRED" 2>/dev/null`
1269313421 else
1269413422 pkg_failed=yes
1269513423 fi
1269613424 else
1269713425 pkg_failed=untried
1269813426 fi
12699 if test -n "$GTKVNC_LIBS"; then
12700 pkg_cv_GTKVNC_LIBS="$GTKVNC_LIBS"
13427 if test -n "$GTK_VNC_LIBS"; then
13428 pkg_cv_GTK_VNC_LIBS="$GTK_VNC_LIBS"
1270113429 elif test -n "$PKG_CONFIG"; then
1270213430 if test -n "$PKG_CONFIG" && \
12703 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-vnc-1.0 >= 0.3.8\""; } >&5
12704 ($PKG_CONFIG --exists --print-errors "gtk-vnc-1.0 >= 0.3.8") 2>&5
13431 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-vnc-\$GTK_VNC_API_VERSION >= \$GTK_VNC_REQUIRED\""; } >&5
13432 ($PKG_CONFIG --exists --print-errors "gtk-vnc-$GTK_VNC_API_VERSION >= $GTK_VNC_REQUIRED") 2>&5
1270513433 ac_status=$?
1270613434 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1270713435 test $ac_status = 0; }; then
12708 pkg_cv_GTKVNC_LIBS=`$PKG_CONFIG --libs "gtk-vnc-1.0 >= 0.3.8" 2>/dev/null`
13436 pkg_cv_GTK_VNC_LIBS=`$PKG_CONFIG --libs "gtk-vnc-$GTK_VNC_API_VERSION >= $GTK_VNC_REQUIRED" 2>/dev/null`
1270913437 else
1271013438 pkg_failed=yes
1271113439 fi
1272513453 _pkg_short_errors_supported=no
1272613454 fi
1272713455 if test $_pkg_short_errors_supported = yes; then
12728 GTKVNC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk-vnc-1.0 >= 0.3.8" 2>&1`
13456 GTK_VNC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk-vnc-$GTK_VNC_API_VERSION >= $GTK_VNC_REQUIRED" 2>&1`
1272913457 else
12730 GTKVNC_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk-vnc-1.0 >= 0.3.8" 2>&1`
13458 GTK_VNC_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk-vnc-$GTK_VNC_API_VERSION >= $GTK_VNC_REQUIRED" 2>&1`
1273113459 fi
1273213460 # Put the nasty error message in config.log where it belongs
12733 echo "$GTKVNC_PKG_ERRORS" >&5
12734
12735 as_fn_error $? "Package requirements (gtk-vnc-1.0 >= 0.3.8) were not met:
12736
12737 $GTKVNC_PKG_ERRORS
13461 echo "$GTK_VNC_PKG_ERRORS" >&5
13462
13463 as_fn_error $? "Package requirements (gtk-vnc-$GTK_VNC_API_VERSION >= $GTK_VNC_REQUIRED) were not met:
13464
13465 $GTK_VNC_PKG_ERRORS
1273813466
1273913467 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1274013468 installed software in a non-standard prefix.
1274113469
12742 Alternatively, you may set the environment variables GTKVNC_CFLAGS
12743 and GTKVNC_LIBS to avoid the need to call pkg-config.
13470 Alternatively, you may set the environment variables GTK_VNC_CFLAGS
13471 and GTK_VNC_LIBS to avoid the need to call pkg-config.
1274413472 See the pkg-config man page for more details." "$LINENO" 5
1274513473
1274613474 elif test $pkg_failed = untried; then
1275213480 is in your PATH or set the PKG_CONFIG environment variable to the full
1275313481 path to pkg-config.
1275413482
12755 Alternatively, you may set the environment variables GTKVNC_CFLAGS
12756 and GTKVNC_LIBS to avoid the need to call pkg-config.
13483 Alternatively, you may set the environment variables GTK_VNC_CFLAGS
13484 and GTK_VNC_LIBS to avoid the need to call pkg-config.
1275713485 See the pkg-config man page for more details.
1275813486
1275913487 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
1276013488 See \`config.log' for more details" "$LINENO" 5; }
1276113489
1276213490 else
12763 GTKVNC_CFLAGS=$pkg_cv_GTKVNC_CFLAGS
12764 GTKVNC_LIBS=$pkg_cv_GTKVNC_LIBS
13491 GTK_VNC_CFLAGS=$pkg_cv_GTK_VNC_CFLAGS
13492 GTK_VNC_LIBS=$pkg_cv_GTK_VNC_LIBS
1276513493 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1276613494 $as_echo "yes" >&6; }
1276713495
1277713505 if test "x$with_spice_gtk" != "xno"; then :
1277813506
1277913507 pkg_failed=no
12780 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SPICEGTK" >&5
12781 $as_echo_n "checking for SPICEGTK... " >&6; }
12782
12783 if test -n "$SPICEGTK_CFLAGS"; then
12784 pkg_cv_SPICEGTK_CFLAGS="$SPICEGTK_CFLAGS"
13508 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SPICE_GTK" >&5
13509 $as_echo_n "checking for SPICE_GTK... " >&6; }
13510
13511 if test -n "$SPICE_GTK_CFLAGS"; then
13512 pkg_cv_SPICE_GTK_CFLAGS="$SPICE_GTK_CFLAGS"
1278513513 elif test -n "$PKG_CONFIG"; then
1278613514 if test -n "$PKG_CONFIG" && \
12787 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-2.0 >= 0.5\""; } >&5
12788 ($PKG_CONFIG --exists --print-errors "spice-client-gtk-2.0 >= 0.5") 2>&5
13515 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-\$SPICE_GTK_API_VERSION >= \$SPICE_GTK_REQUIRED\""; } >&5
13516 ($PKG_CONFIG --exists --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED") 2>&5
1278913517 ac_status=$?
1279013518 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1279113519 test $ac_status = 0; }; then
12792 pkg_cv_SPICEGTK_CFLAGS=`$PKG_CONFIG --cflags "spice-client-gtk-2.0 >= 0.5" 2>/dev/null`
13520 pkg_cv_SPICE_GTK_CFLAGS=`$PKG_CONFIG --cflags "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>/dev/null`
1279313521 else
1279413522 pkg_failed=yes
1279513523 fi
1279613524 else
1279713525 pkg_failed=untried
1279813526 fi
12799 if test -n "$SPICEGTK_LIBS"; then
12800 pkg_cv_SPICEGTK_LIBS="$SPICEGTK_LIBS"
13527 if test -n "$SPICE_GTK_LIBS"; then
13528 pkg_cv_SPICE_GTK_LIBS="$SPICE_GTK_LIBS"
1280113529 elif test -n "$PKG_CONFIG"; then
1280213530 if test -n "$PKG_CONFIG" && \
12803 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-2.0 >= 0.5\""; } >&5
12804 ($PKG_CONFIG --exists --print-errors "spice-client-gtk-2.0 >= 0.5") 2>&5
13531 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spice-client-gtk-\$SPICE_GTK_API_VERSION >= \$SPICE_GTK_REQUIRED\""; } >&5
13532 ($PKG_CONFIG --exists --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED") 2>&5
1280513533 ac_status=$?
1280613534 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1280713535 test $ac_status = 0; }; then
12808 pkg_cv_SPICEGTK_LIBS=`$PKG_CONFIG --libs "spice-client-gtk-2.0 >= 0.5" 2>/dev/null`
13536 pkg_cv_SPICE_GTK_LIBS=`$PKG_CONFIG --libs "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>/dev/null`
1280913537 else
1281013538 pkg_failed=yes
1281113539 fi
1282513553 _pkg_short_errors_supported=no
1282613554 fi
1282713555 if test $_pkg_short_errors_supported = yes; then
12828 SPICEGTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "spice-client-gtk-2.0 >= 0.5" 2>&1`
13556 SPICE_GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>&1`
1282913557 else
12830 SPICEGTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "spice-client-gtk-2.0 >= 0.5" 2>&1`
13558 SPICE_GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED" 2>&1`
1283113559 fi
1283213560 # Put the nasty error message in config.log where it belongs
12833 echo "$SPICEGTK_PKG_ERRORS" >&5
13561 echo "$SPICE_GTK_PKG_ERRORS" >&5
1283413562
1283513563 have_spice_gtk=no
1283613564 elif test $pkg_failed = untried; then
1283813566 $as_echo "no" >&6; }
1283913567 have_spice_gtk=no
1284013568 else
12841 SPICEGTK_CFLAGS=$pkg_cv_SPICEGTK_CFLAGS
12842 SPICEGTK_LIBS=$pkg_cv_SPICEGTK_LIBS
13569 SPICE_GTK_CFLAGS=$pkg_cv_SPICE_GTK_CFLAGS
13570 SPICE_GTK_LIBS=$pkg_cv_SPICE_GTK_LIBS
1284313571 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1284413572 $as_echo "yes" >&6; }
1284513573 have_spice_gtk=yes
1333114059 :end' >>confcache
1333214060 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
1333314061 if test -w "$cache_file"; then
13334 test "x$cache_file" != "x/dev/null" &&
14062 if test "x$cache_file" != "x/dev/null"; then
1333514063 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
1333614064 $as_echo "$as_me: updating cache $cache_file" >&6;}
13337 cat confcache >$cache_file
14065 if test ! -f "$cache_file" || test -h "$cache_file"; then
14066 cat confcache >"$cache_file"
14067 else
14068 case $cache_file in #(
14069 */* | ?:*)
14070 mv -f confcache "$cache_file"$$ &&
14071 mv -f "$cache_file"$$ "$cache_file" ;; #(
14072 *)
14073 mv -f confcache "$cache_file" ;;
14074 esac
14075 fi
14076 fi
1333814077 else
1333914078 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
1334014079 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
1338514124 ac_config_commands="$ac_config_commands po/stamp-it"
1338614125
1338714126
14127 if test -z "${HAVE_GTK_2_TRUE}" && test -z "${HAVE_GTK_2_FALSE}"; then
14128 as_fn_error $? "conditional \"HAVE_GTK_2\" was never defined.
14129 Usually this means the macro was only invoked conditionally." "$LINENO" 5
14130 fi
14131 if test -z "${HAVE_GTK_3_TRUE}" && test -z "${HAVE_GTK_3_FALSE}"; then
14132 as_fn_error $? "conditional \"HAVE_GTK_3\" was never defined.
14133 Usually this means the macro was only invoked conditionally." "$LINENO" 5
14134 fi
1338814135 if test -z "${HAVE_SPICE_GTK_TRUE}" && test -z "${HAVE_SPICE_GTK_FALSE}"; then
1338914136 as_fn_error $? "conditional \"HAVE_SPICE_GTK\" was never defined.
1339014137 Usually this means the macro was only invoked conditionally." "$LINENO" 5
1339414141 Usually this means the macro was only invoked conditionally." "$LINENO" 5
1339514142 fi
1339614143
13397 : ${CONFIG_STATUS=./config.status}
14144 : "${CONFIG_STATUS=./config.status}"
1339814145 ac_write_fail=0
1339914146 ac_clean_files_save=$ac_clean_files
1340014147 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
1349514242 IFS=" "" $as_nl"
1349614243
1349714244 # Find who we are. Look in the path if we contain no directory separator.
14245 as_myself=
1349814246 case $0 in #((
1349914247 *[\\/]* ) as_myself=$0 ;;
1350014248 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1380114549 # report actual input values of CONFIG_FILES etc. instead of their
1380214550 # values after options handling.
1380314551 ac_log="
13804 This file was extended by virt-viewer $as_me 0.3.1, which was
13805 generated by GNU Autoconf 2.66. Invocation command line was
14552 This file was extended by virt-viewer $as_me 0.4.0, which was
14553 generated by GNU Autoconf 2.68. Invocation command line was
1380614554
1380714555 CONFIG_FILES = $CONFIG_FILES
1380814556 CONFIG_HEADERS = $CONFIG_HEADERS
1386714615 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1386814616 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1386914617 ac_cs_version="\\
13870 virt-viewer config.status 0.3.1
13871 configured by $0, generated by GNU Autoconf 2.66,
14618 virt-viewer config.status 0.4.0
14619 configured by $0, generated by GNU Autoconf 2.68,
1387214620 with options \\"\$ac_cs_config\\"
1387314621
1387414622 Copyright (C) 2010 Free Software Foundation, Inc.
1388914637 while test $# != 0
1389014638 do
1389114639 case $1 in
13892 --*=*)
14640 --*=?*)
1389314641 ac_option=`expr "X$1" : 'X\([^=]*\)='`
1389414642 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
14643 ac_shift=:
14644 ;;
14645 --*=)
14646 ac_option=`expr "X$1" : 'X\([^=]*\)='`
14647 ac_optarg=
1389514648 ac_shift=:
1389614649 ;;
1389714650 *)
1391514668 $ac_shift
1391614669 case $ac_optarg in
1391714670 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
14671 '') as_fn_error $? "missing file argument" ;;
1391814672 esac
1391914673 as_fn_append CONFIG_FILES " '$ac_optarg'"
1392014674 ac_need_defaults=false;;
1401814772 lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
1401914773 lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
1402014774 lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
14775 lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
14776 lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
1402114777 reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
1402214778 reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
1402314779 OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
1402414780 deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
1402514781 file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
14782 file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
14783 want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
14784 DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
14785 sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
1402614786 AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
1402714787 AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
14788 archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
1402814789 STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
1402914790 RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
1403014791 old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
1403914800 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
1404014801 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
1404114802 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"`'
14803 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
14804 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
1404214805 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
1404314806 MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
1404414807 lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
14808 lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
1404514809 lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
14046 lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
1404714810 lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
1404814811 lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
1404914812 need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
14813 MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
1405014814 DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
1405114815 NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
1405214816 LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
1407914843 hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
1408014844 inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
1408114845 link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
14082 fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
1408314846 always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
1408414847 export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
1408514848 exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
1408614849 include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
1408714850 prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
14851 postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
1408814852 file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
1408914853 variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
1409014854 need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
1413914903 OBJDUMP \
1414014904 deplibs_check_method \
1414114905 file_magic_cmd \
14906 file_magic_glob \
14907 want_nocaseglob \
14908 DLLTOOL \
14909 sharedlib_from_linklib_cmd \
1414214910 AR \
1414314911 AR_FLAGS \
14912 archiver_list_spec \
1414414913 STRIP \
1414514914 RANLIB \
1414614915 CC \
1415014919 lt_cv_sys_global_symbol_to_cdecl \
1415114920 lt_cv_sys_global_symbol_to_c_name_address \
1415214921 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
14922 nm_file_list_spec \
1415314923 lt_prog_compiler_no_builtin_flag \
14924 lt_prog_compiler_pic \
1415414925 lt_prog_compiler_wl \
14155 lt_prog_compiler_pic \
1415614926 lt_prog_compiler_static \
1415714927 lt_cv_prog_compiler_c_o \
1415814928 need_locks \
14929 MANIFEST_TOOL \
1415914930 DSYMUTIL \
1416014931 NMEDIT \
1416114932 LIPO \
1417114942 hardcode_libdir_flag_spec \
1417214943 hardcode_libdir_flag_spec_ld \
1417314944 hardcode_libdir_separator \
14174 fix_srcfile_path \
1417514945 exclude_expsyms \
1417614946 include_expsyms \
1417714947 file_list_spec \
1420714977 module_expsym_cmds \
1420814978 export_symbols_cmds \
1420914979 prelink_cmds \
14980 postlink_cmds \
1421014981 postinstall_cmds \
1421114982 postuninstall_cmds \
1421214983 finish_cmds \
1428715058 # after its creation but before its name has been assigned to `$tmp'.
1428815059 $debug ||
1428915060 {
14290 tmp=
15061 tmp= ac_tmp=
1429115062 trap 'exit_status=$?
14292 { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
15063 : "${ac_tmp:=$tmp}"
15064 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
1429315065 ' 0
1429415066 trap 'as_fn_exit 1' 1 2 13 15
1429515067 }
1429715069
1429815070 {
1429915071 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
14300 test -n "$tmp" && test -d "$tmp"
15072 test -d "$tmp"
1430115073 } ||
1430215074 {
1430315075 tmp=./conf$$-$RANDOM
1430415076 (umask 077 && mkdir "$tmp")
1430515077 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
15078 ac_tmp=$tmp
1430615079
1430715080 # Set up the scripts for CONFIG_FILES section.
1430815081 # No need to generate them if there are no CONFIG_FILES.
1432415097 ac_cs_awk_cr=$ac_cr
1432515098 fi
1432615099
14327 echo 'BEGIN {' >"$tmp/subs1.awk" &&
15100 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
1432815101 _ACEOF
1432915102
1433015103
1435215125 rm -f conf$$subs.sh
1435315126
1435415127 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14355 cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
15128 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
1435615129 _ACEOF
1435715130 sed -n '
1435815131 h
1440015173 rm -f conf$$subs.awk
1440115174 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1440215175 _ACAWK
14403 cat >>"\$tmp/subs1.awk" <<_ACAWK &&
15176 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
1440415177 for (key in S) S_is_set[key] = 1
1440515178 FS = ""
1440615179
1443215205 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
1443315206 else
1443415207 cat
14435 fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
15208 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
1443615209 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
1443715210 _ACEOF
1443815211
1446615239 # No need to generate them if there are no CONFIG_HEADERS.
1446715240 # This happens for instance with `./config.status Makefile'.
1446815241 if test -n "$CONFIG_HEADERS"; then
14469 cat >"$tmp/defines.awk" <<\_ACAWK ||
15242 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
1447015243 BEGIN {
1447115244 _ACEOF
1447215245
1447815251 # handling of long lines.
1447915252 ac_delim='%!_!# '
1448015253 for ac_last_try in false false :; do
14481 ac_t=`sed -n "/$ac_delim/p" confdefs.h`
14482 if test -z "$ac_t"; then
15254 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
15255 if test -z "$ac_tt"; then
1448315256 break
1448415257 elif $ac_last_try; then
1448515258 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
1459915372 for ac_f
1460015373 do
1460115374 case $ac_f in
14602 -) ac_f="$tmp/stdin";;
15375 -) ac_f="$ac_tmp/stdin";;
1460315376 *) # Look for the file first in the build tree, then in the source tree
1460415377 # (if the path is not absolute). The absolute path cannot be DOS-style,
1460515378 # because $ac_f cannot contain `:'.
1463415407 esac
1463515408
1463615409 case $ac_tag in
14637 *:-:* | *:-) cat >"$tmp/stdin" \
15410 *:-:* | *:-) cat >"$ac_tmp/stdin" \
1463815411 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
1463915412 esac
1464015413 ;;
1477115544 s&@MKDIR_P@&$ac_MKDIR_P&;t t
1477215545 $ac_datarootdir_hack
1477315546 "
14774 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
14775 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
15547 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
15548 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
1477615549
1477715550 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
14778 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
14779 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
15551 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
15552 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
15553 "$ac_tmp/out"`; test -z "$ac_out"; } &&
1478015554 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
1478115555 which seems to be undefined. Please make sure it is defined" >&5
1478215556 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
1478315557 which seems to be undefined. Please make sure it is defined" >&2;}
1478415558
14785 rm -f "$tmp/stdin"
15559 rm -f "$ac_tmp/stdin"
1478615560 case $ac_file in
14787 -) cat "$tmp/out" && rm -f "$tmp/out";;
14788 *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
15561 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
15562 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
1478915563 esac \
1479015564 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
1479115565 ;;
1479615570 if test x"$ac_file" != x-; then
1479715571 {
1479815572 $as_echo "/* $configure_input */" \
14799 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
14800 } >"$tmp/config.h" \
15573 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
15574 } >"$ac_tmp/config.h" \
1480115575 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
14802 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
15576 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
1480315577 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
1480415578 $as_echo "$as_me: $ac_file is unchanged" >&6;}
1480515579 else
1480615580 rm -f "$ac_file"
14807 mv "$tmp/config.h" "$ac_file" \
15581 mv "$ac_tmp/config.h" "$ac_file" \
1480815582 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
1480915583 fi
1481015584 else
1481115585 $as_echo "/* $configure_input */" \
14812 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
15586 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
1481315587 || as_fn_error $? "could not create -" "$LINENO" 5
1481415588 fi
1481515589 # Compute "$ac_file"'s index in $config_headers.
1507515849 # turn newlines into spaces.
1507615850 NL2SP=$lt_lt_NL2SP
1507715851
15852 # convert \$build file names to \$host format.
15853 to_host_file_cmd=$lt_cv_to_host_file_cmd
15854
15855 # convert \$build files to toolchain format.
15856 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
15857
1507815858 # An object symbol dumper.
1507915859 OBJDUMP=$lt_OBJDUMP
1508015860
1508115861 # Method to check whether dependent libraries are shared objects.
1508215862 deplibs_check_method=$lt_deplibs_check_method
1508315863
15084 # Command to use when deplibs_check_method == "file_magic".
15864 # Command to use when deplibs_check_method = "file_magic".
1508515865 file_magic_cmd=$lt_file_magic_cmd
15866
15867 # How to find potential files when deplibs_check_method = "file_magic".
15868 file_magic_glob=$lt_file_magic_glob
15869
15870 # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
15871 want_nocaseglob=$lt_want_nocaseglob
15872
15873 # DLL creation program.
15874 DLLTOOL=$lt_DLLTOOL
15875
15876 # Command to associate shared and link libraries.
15877 sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
1508615878
1508715879 # The archiver.
1508815880 AR=$lt_AR
15881
15882 # Flags to create an archive.
1508915883 AR_FLAGS=$lt_AR_FLAGS
15884
15885 # How to feed a file listing to the archiver.
15886 archiver_list_spec=$lt_archiver_list_spec
1509015887
1509115888 # A symbol stripping program.
1509215889 STRIP=$lt_STRIP
1511715914 # Transform the output of nm in a C name address pair when lib prefix is needed.
1511815915 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
1511915916
15917 # Specify filename containing input files for \$NM.
15918 nm_file_list_spec=$lt_nm_file_list_spec
15919
15920 # The root where to search for dependent libraries,and in which our libraries should be installed.
15921 lt_sysroot=$lt_sysroot
15922
1512015923 # The name of the directory that contains temporary libtool files.
1512115924 objdir=$objdir
1512215925
1512515928
1512615929 # Must we lock files when doing compilation?
1512715930 need_locks=$lt_need_locks
15931
15932 # Manifest tool.
15933 MANIFEST_TOOL=$lt_MANIFEST_TOOL
1512815934
1512915935 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
1513015936 DSYMUTIL=$lt_DSYMUTIL
1524016046 # Compiler flag to turn off builtin functions.
1524116047 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
1524216048
16049 # Additional compiler flags for building library objects.
16050 pic_flag=$lt_lt_prog_compiler_pic
16051
1524316052 # How to pass a linker flag through the compiler.
1524416053 wl=$lt_lt_prog_compiler_wl
15245
15246 # Additional compiler flags for building library objects.
15247 pic_flag=$lt_lt_prog_compiler_pic
1524816054
1524916055 # Compiler flag to prevent dynamic linking.
1525016056 link_static_flag=$lt_lt_prog_compiler_static
1533216138 # Whether libtool must link a program against all its dependency libraries.
1533316139 link_all_deplibs=$link_all_deplibs
1533416140
15335 # Fix the shell variable \$srcfile for the compiler.
15336 fix_srcfile_path=$lt_fix_srcfile_path
15337
1533816141 # Set to "yes" if exported symbols are required.
1533916142 always_export_symbols=$always_export_symbols
1534016143
1534916152
1535016153 # Commands necessary for linking programs (against libraries) with templates.
1535116154 prelink_cmds=$lt_prelink_cmds
16155
16156 # Commands necessary for finishing linking programs.
16157 postlink_cmds=$lt_postlink_cmds
1535216158
1535316159 # Specify filename containing input files.
1535416160 file_list_spec=$lt_file_list_spec
1538216188 # if finds mixed CR/LF and LF-only lines. Since sed operates in
1538316189 # text mode, it properly converts lines to CR/LF. This bash problem
1538416190 # is reportedly fixed, but why not run on old versions too?
15385 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
15386 || (rm -f "$cfgfile"; exit 1)
15387
15388 case $xsi_shell in
15389 yes)
15390 cat << \_LT_EOF >> "$cfgfile"
15391
15392 # func_dirname file append nondir_replacement
15393 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
15394 # otherwise set result to NONDIR_REPLACEMENT.
15395 func_dirname ()
15396 {
15397 case ${1} in
15398 */*) func_dirname_result="${1%/*}${2}" ;;
15399 * ) func_dirname_result="${3}" ;;
15400 esac
15401 }
15402
15403 # func_basename file
15404 func_basename ()
15405 {
15406 func_basename_result="${1##*/}"
15407 }
15408
15409 # func_dirname_and_basename file append nondir_replacement
15410 # perform func_basename and func_dirname in a single function
15411 # call:
15412 # dirname: Compute the dirname of FILE. If nonempty,
15413 # add APPEND to the result, otherwise set result
15414 # to NONDIR_REPLACEMENT.
15415 # value returned in "$func_dirname_result"
15416 # basename: Compute filename of FILE.
15417 # value retuned in "$func_basename_result"
15418 # Implementation must be kept synchronized with func_dirname
15419 # and func_basename. For efficiency, we do not delegate to
15420 # those functions but instead duplicate the functionality here.
15421 func_dirname_and_basename ()
15422 {
15423 case ${1} in
15424 */*) func_dirname_result="${1%/*}${2}" ;;
15425 * ) func_dirname_result="${3}" ;;
15426 esac
15427 func_basename_result="${1##*/}"
15428 }
15429
15430 # func_stripname prefix suffix name
15431 # strip PREFIX and SUFFIX off of NAME.
15432 # PREFIX and SUFFIX must not contain globbing or regex special
15433 # characters, hashes, percent signs, but SUFFIX may contain a leading
15434 # dot (in which case that matches only a dot).
15435 func_stripname ()
15436 {
15437 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
15438 # positional parameters, so assign one to ordinary parameter first.
15439 func_stripname_result=${3}
15440 func_stripname_result=${func_stripname_result#"${1}"}
15441 func_stripname_result=${func_stripname_result%"${2}"}
15442 }
15443
15444 # func_opt_split
15445 func_opt_split ()
15446 {
15447 func_opt_split_opt=${1%%=*}
15448 func_opt_split_arg=${1#*=}
15449 }
15450
15451 # func_lo2o object
15452 func_lo2o ()
15453 {
15454 case ${1} in
15455 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
15456 *) func_lo2o_result=${1} ;;
15457 esac
15458 }
15459
15460 # func_xform libobj-or-source
15461 func_xform ()
15462 {
15463 func_xform_result=${1%.*}.lo
15464 }
15465
15466 # func_arith arithmetic-term...
15467 func_arith ()
15468 {
15469 func_arith_result=$(( $* ))
15470 }
15471
15472 # func_len string
15473 # STRING may not start with a hyphen.
15474 func_len ()
15475 {
15476 func_len_result=${#1}
15477 }
15478
15479 _LT_EOF
15480 ;;
15481 *) # Bourne compatible functions.
15482 cat << \_LT_EOF >> "$cfgfile"
15483
15484 # func_dirname file append nondir_replacement
15485 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
15486 # otherwise set result to NONDIR_REPLACEMENT.
15487 func_dirname ()
15488 {
15489 # Extract subdirectory from the argument.
15490 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
15491 if test "X$func_dirname_result" = "X${1}"; then
15492 func_dirname_result="${3}"
15493 else
15494 func_dirname_result="$func_dirname_result${2}"
15495 fi
15496 }
15497
15498 # func_basename file
15499 func_basename ()
15500 {
15501 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
15502 }
15503
15504
15505 # func_stripname prefix suffix name
15506 # strip PREFIX and SUFFIX off of NAME.
15507 # PREFIX and SUFFIX must not contain globbing or regex special
15508 # characters, hashes, percent signs, but SUFFIX may contain a leading
15509 # dot (in which case that matches only a dot).
15510 # func_strip_suffix prefix name
15511 func_stripname ()
15512 {
15513 case ${2} in
15514 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
15515 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
15516 esac
15517 }
15518
15519 # sed scripts:
15520 my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
15521 my_sed_long_arg='1s/^-[^=]*=//'
15522
15523 # func_opt_split
15524 func_opt_split ()
15525 {
15526 func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
15527 func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
15528 }
15529
15530 # func_lo2o object
15531 func_lo2o ()
15532 {
15533 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
15534 }
15535
15536 # func_xform libobj-or-source
15537 func_xform ()
15538 {
15539 func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
15540 }
15541
15542 # func_arith arithmetic-term...
15543 func_arith ()
15544 {
15545 func_arith_result=`expr "$@"`
15546 }
15547
15548 # func_len string
15549 # STRING may not start with a hyphen.
15550 func_len ()
15551 {
15552 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
15553 }
15554
15555 _LT_EOF
15556 esac
15557
15558 case $lt_shell_append in
15559 yes)
15560 cat << \_LT_EOF >> "$cfgfile"
15561
15562 # func_append var value
15563 # Append VALUE to the end of shell variable VAR.
15564 func_append ()
15565 {
15566 eval "$1+=\$2"
15567 }
15568 _LT_EOF
15569 ;;
15570 *)
15571 cat << \_LT_EOF >> "$cfgfile"
15572
15573 # func_append var value
15574 # Append VALUE to the end of shell variable VAR.
15575 func_append ()
15576 {
15577 eval "$1=\$$1\$2"
15578 }
15579
15580 _LT_EOF
15581 ;;
15582 esac
15583
15584
15585 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
15586 || (rm -f "$cfgfile"; exit 1)
15587
15588 mv -f "$cfgfile" "$ofile" ||
16191 sed '$q' "$ltmain" >> "$cfgfile" \
16192 || (rm -f "$cfgfile"; exit 1)
16193
16194 if test x"$xsi_shell" = xyes; then
16195 sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
16196 func_dirname ()\
16197 {\
16198 \ case ${1} in\
16199 \ */*) func_dirname_result="${1%/*}${2}" ;;\
16200 \ * ) func_dirname_result="${3}" ;;\
16201 \ esac\
16202 } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
16203 && mv -f "$cfgfile.tmp" "$cfgfile" \
16204 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16205 test 0 -eq $? || _lt_function_replace_fail=:
16206
16207
16208 sed -e '/^func_basename ()$/,/^} # func_basename /c\
16209 func_basename ()\
16210 {\
16211 \ func_basename_result="${1##*/}"\
16212 } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
16213 && mv -f "$cfgfile.tmp" "$cfgfile" \
16214 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16215 test 0 -eq $? || _lt_function_replace_fail=:
16216
16217
16218 sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
16219 func_dirname_and_basename ()\
16220 {\
16221 \ case ${1} in\
16222 \ */*) func_dirname_result="${1%/*}${2}" ;;\
16223 \ * ) func_dirname_result="${3}" ;;\
16224 \ esac\
16225 \ func_basename_result="${1##*/}"\
16226 } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
16227 && mv -f "$cfgfile.tmp" "$cfgfile" \
16228 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16229 test 0 -eq $? || _lt_function_replace_fail=:
16230
16231
16232 sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
16233 func_stripname ()\
16234 {\
16235 \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
16236 \ # positional parameters, so assign one to ordinary parameter first.\
16237 \ func_stripname_result=${3}\
16238 \ func_stripname_result=${func_stripname_result#"${1}"}\
16239 \ func_stripname_result=${func_stripname_result%"${2}"}\
16240 } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
16241 && mv -f "$cfgfile.tmp" "$cfgfile" \
16242 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16243 test 0 -eq $? || _lt_function_replace_fail=:
16244
16245
16246 sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
16247 func_split_long_opt ()\
16248 {\
16249 \ func_split_long_opt_name=${1%%=*}\
16250 \ func_split_long_opt_arg=${1#*=}\
16251 } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
16252 && mv -f "$cfgfile.tmp" "$cfgfile" \
16253 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16254 test 0 -eq $? || _lt_function_replace_fail=:
16255
16256
16257 sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
16258 func_split_short_opt ()\
16259 {\
16260 \ func_split_short_opt_arg=${1#??}\
16261 \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
16262 } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
16263 && mv -f "$cfgfile.tmp" "$cfgfile" \
16264 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16265 test 0 -eq $? || _lt_function_replace_fail=:
16266
16267
16268 sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
16269 func_lo2o ()\
16270 {\
16271 \ case ${1} in\
16272 \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
16273 \ *) func_lo2o_result=${1} ;;\
16274 \ esac\
16275 } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
16276 && mv -f "$cfgfile.tmp" "$cfgfile" \
16277 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16278 test 0 -eq $? || _lt_function_replace_fail=:
16279
16280
16281 sed -e '/^func_xform ()$/,/^} # func_xform /c\
16282 func_xform ()\
16283 {\
16284 func_xform_result=${1%.*}.lo\
16285 } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
16286 && mv -f "$cfgfile.tmp" "$cfgfile" \
16287 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16288 test 0 -eq $? || _lt_function_replace_fail=:
16289
16290
16291 sed -e '/^func_arith ()$/,/^} # func_arith /c\
16292 func_arith ()\
16293 {\
16294 func_arith_result=$(( $* ))\
16295 } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
16296 && mv -f "$cfgfile.tmp" "$cfgfile" \
16297 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16298 test 0 -eq $? || _lt_function_replace_fail=:
16299
16300
16301 sed -e '/^func_len ()$/,/^} # func_len /c\
16302 func_len ()\
16303 {\
16304 func_len_result=${#1}\
16305 } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
16306 && mv -f "$cfgfile.tmp" "$cfgfile" \
16307 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16308 test 0 -eq $? || _lt_function_replace_fail=:
16309
16310 fi
16311
16312 if test x"$lt_shell_append" = xyes; then
16313 sed -e '/^func_append ()$/,/^} # func_append /c\
16314 func_append ()\
16315 {\
16316 eval "${1}+=\\${2}"\
16317 } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
16318 && mv -f "$cfgfile.tmp" "$cfgfile" \
16319 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16320 test 0 -eq $? || _lt_function_replace_fail=:
16321
16322
16323 sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
16324 func_append_quoted ()\
16325 {\
16326 \ func_quote_for_eval "${2}"\
16327 \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
16328 } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
16329 && mv -f "$cfgfile.tmp" "$cfgfile" \
16330 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16331 test 0 -eq $? || _lt_function_replace_fail=:
16332
16333
16334 # Save a `func_append' function call where possible by direct use of '+='
16335 sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
16336 && mv -f "$cfgfile.tmp" "$cfgfile" \
16337 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16338 test 0 -eq $? || _lt_function_replace_fail=:
16339 else
16340 # Save a `func_append' function call even when '+=' is not available
16341 sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
16342 && mv -f "$cfgfile.tmp" "$cfgfile" \
16343 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16344 test 0 -eq $? || _lt_function_replace_fail=:
16345 fi
16346
16347 if test x"$_lt_function_replace_fail" = x":"; then
16348 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
16349 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
16350 fi
16351
16352
16353 mv -f "$cfgfile" "$ofile" ||
1558916354 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1559016355 chmod +x "$ofile"
1559116356
00
1 AC_INIT(virt-viewer, 0.3.1)
2 AC_CONFIG_SRCDIR(src/main.c)
1 AC_INIT(virt-viewer, 0.4.0)
2 AC_CONFIG_SRCDIR(src/virt-viewer-main.c)
33 AM_CONFIG_HEADER(config.h)
44 dnl Make automake keep quiet about wildcards & other GNUmake-isms
55 AM_INIT_AUTOMAKE([-Wno-portability])
88 # Use the silent-rules feature when possible.
99 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
1010 AM_SILENT_RULES([yes])
11
12 GLIB2_REQUIRED=2.12.0
13 LIBXML2_REQUIRED="2.6.0"
14 LIBVIRT_REQUIRED="0.6.0"
15 GTK2_REQUIRED="2.12.0"
16 GTK3_REQUIRED="3.0"
17 GTK_VNC_REQUIRED="0.3.8"
18 SPICE_GTK_REQUIRED="0.6"
1119
1220 AC_PROG_CC
1321 AM_PROG_CC_C_O
2735 AM_GLIB_GNU_GETTEXT
2836
2937
30 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.6.0)
31 PKG_CHECK_MODULES(LIBVIRT, libvirt >= 0.6.0)
32 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.10.0)
33 PKG_CHECK_MODULES(LIBGLADE2, libglade-2.0 >= 2.6.0)
34 PKG_CHECK_MODULES(GTKVNC, gtk-vnc-1.0 >= 0.3.8)
38 PKG_CHECK_MODULES(GLIB2, gmodule-export-2.0 >= $GLIB2_REQUIRED)
39 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_REQUIRED)
40 PKG_CHECK_MODULES(LIBVIRT, libvirt >= $LIBVIRT_REQUIRED)
41
42 AC_MSG_CHECKING([which gtk+ version to compile against])
43 AC_ARG_WITH([gtk],
44 [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
45 [case "$with_gtk" in
46 2.0|3.0) ;;
47 *) AC_MSG_ERROR([invalid gtk version specified]) ;;
48 esac],
49 [with_gtk=2.0])
50 AC_MSG_RESULT([$with_gtk])
51
52 case "$with_gtk" in
53 2.0) GTK_API_VERSION=2.0
54 GTK_REQUIRED=$GTK2_REQUIRED
55 GTK_VNC_API_VERSION=1.0
56 SPICE_GTK_API_VERSION=2.0
57 ;;
58 3.0) GTK_API_VERSION=3.0
59 GTK_REQUIRED=$GTK3_REQUIRED
60 GTK_VNC_API_VERSION=2.0
61 SPICE_GTK_API_VERSION=3.0
62 ;;
63 esac
64
65 AC_SUBST([GTK_API_VERSION])
66 AC_SUBST([GTK_REQUIRED])
67 AC_SUBST([GTK_VNC_API_VERSION])
68 AM_CONDITIONAL([HAVE_GTK_2],[test "$with_gtk" = "2.0"])
69 AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk" = "3.0"])
70
71 PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
72
73 PKG_CHECK_MODULES(GTK_VNC, gtk-vnc-$GTK_VNC_API_VERSION >= $GTK_VNC_REQUIRED)
3574
3675 AC_ARG_WITH([spice-gtk],
3776 AS_HELP_STRING([--without-spice-gtk], [Ignore presence of spice-gtk and disable it]))
3877
3978 AS_IF([test "x$with_spice_gtk" != "xno"],
40 [PKG_CHECK_MODULES(SPICEGTK, spice-client-gtk-2.0 >= 0.5, [have_spice_gtk=yes], [have_spice_gtk=no])],
79 [PKG_CHECK_MODULES(SPICE_GTK,
80 spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED,
81 [have_spice_gtk=yes], [have_spice_gtk=no])],
4182 [have_spice_gtk=no])
4283
4384 AS_IF([test "x$have_spice_gtk" = "xyes"],
+1636
-745
ltmain.sh less more
0 # Generated from ltmain.m4sh.
1
2 # libtool (GNU libtool) 2.2.10
0
1 # libtool (GNU libtool) 2.4
32 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
43
54 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
6968 # compiler: $LTCC
7069 # compiler flags: $LTCFLAGS
7170 # linker: $LD (gnu? $with_gnu_ld)
72 # $progname: (GNU libtool) 2.2.10
71 # $progname: (GNU libtool) 2.4
7372 # automake: $automake_version
7473 # autoconf: $autoconf_version
7574 #
7675 # Report bugs to <bug-libtool@gnu.org>.
76 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
77 # General help using GNU software: <http://www.gnu.org/gethelp/>.
7778
7879 PROGRAM=libtool
7980 PACKAGE=libtool
80 VERSION=2.2.10
81 VERSION=2.4
8182 TIMESTAMP=""
82 package_revision=1.3175
83 package_revision=1.3293
8384
8485 # Be Bourne compatible
8586 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
162163 dirname="s,/[^/]*$,,"
163164 basename="s,^.*/,,"
164165
166 # func_dirname file append nondir_replacement
167 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
168 # otherwise set result to NONDIR_REPLACEMENT.
169 func_dirname ()
170 {
171 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
172 if test "X$func_dirname_result" = "X${1}"; then
173 func_dirname_result="${3}"
174 else
175 func_dirname_result="$func_dirname_result${2}"
176 fi
177 } # func_dirname may be replaced by extended shell implementation
178
179
180 # func_basename file
181 func_basename ()
182 {
183 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
184 } # func_basename may be replaced by extended shell implementation
185
186
165187 # func_dirname_and_basename file append nondir_replacement
166188 # perform func_basename and func_dirname in a single function
167189 # call:
176198 # those functions but instead duplicate the functionality here.
177199 func_dirname_and_basename ()
178200 {
179 # Extract subdirectory from the argument.
180 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
181 if test "X$func_dirname_result" = "X${1}"; then
182 func_dirname_result="${3}"
183 else
184 func_dirname_result="$func_dirname_result${2}"
185 fi
186 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
187 }
188
189 # Generated shell functions inserted here.
201 # Extract subdirectory from the argument.
202 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
203 if test "X$func_dirname_result" = "X${1}"; then
204 func_dirname_result="${3}"
205 else
206 func_dirname_result="$func_dirname_result${2}"
207 fi
208 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
209 } # func_dirname_and_basename may be replaced by extended shell implementation
210
211
212 # func_stripname prefix suffix name
213 # strip PREFIX and SUFFIX off of NAME.
214 # PREFIX and SUFFIX must not contain globbing or regex special
215 # characters, hashes, percent signs, but SUFFIX may contain a leading
216 # dot (in which case that matches only a dot).
217 # func_strip_suffix prefix name
218 func_stripname ()
219 {
220 case ${2} in
221 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
222 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
223 esac
224 } # func_stripname may be replaced by extended shell implementation
225
190226
191227 # These SED scripts presuppose an absolute path with a trailing slash.
192228 pathcar='s,^/\([^/]*\).*$,\1,'
369405 # Same as above, but do not quote variable references.
370406 double_quote_subst='s/\(["`\\]\)/\\\1/g'
371407
408 # Sed substitution that turns a string into a regex matching for the
409 # string literally.
410 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
411
412 # Sed substitution that converts a w32 file name or path
413 # which contains forward slashes, into one that contains
414 # (escaped) backslashes. A very naive implementation.
415 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
416
372417 # Re-`\' parameter expansions in output of double_quote_subst that were
373418 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
374419 # in input to double_quote_subst, that '$' was protected from expansion.
397442 # name if it has been set yet.
398443 func_echo ()
399444 {
400 $ECHO "$progname${mode+: }$mode: $*"
445 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
401446 }
402447
403448 # func_verbose arg...
423468 # Echo program name prefixed message to standard error.
424469 func_error ()
425470 {
426 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
471 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
427472 }
428473
429474 # func_warning arg...
430475 # Echo program name prefixed warning message to standard error.
431476 func_warning ()
432477 {
433 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
478 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
434479
435480 # bash bug again:
436481 :
649694 fi
650695 }
651696
697 # func_tr_sh
698 # Turn $1 into a string suitable for a shell variable name.
699 # Result is stored in $func_tr_sh_result. All characters
700 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
701 # if $1 begins with a digit, a '_' is prepended as well.
702 func_tr_sh ()
703 {
704 case $1 in
705 [0-9]* | *[!a-zA-Z0-9_]*)
706 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
707 ;;
708 * )
709 func_tr_sh_result=$1
710 ;;
711 esac
712 }
713
652714
653715 # func_version
654716 # Echo version message to standard output and exit.
655717 func_version ()
656718 {
719 $opt_debug
720
657721 $SED -n '/(C)/!b go
658722 :more
659723 /\./!{
675739 # Echo short help message to standard output and exit.
676740 func_usage ()
677741 {
742 $opt_debug
743
678744 $SED -n '/^# Usage:/,/^# *.*--help/ {
679745 s/^# //
680746 s/^# *$//
691757 # unless 'noexit' is passed as argument.
692758 func_help ()
693759 {
760 $opt_debug
761
694762 $SED -n '/^# Usage:/,/# Report bugs to/ {
763 :print
695764 s/^# //
696765 s/^# *$//
697766 s*\$progname*'$progname'*
704773 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
705774 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
706775 p
707 }' < "$progpath"
776 d
777 }
778 /^# .* home page:/b print
779 /^# General help using/b print
780 ' < "$progpath"
708781 ret=$?
709782 if test -z "$1"; then
710783 exit $ret
716789 # exit_cmd.
717790 func_missing_arg ()
718791 {
792 $opt_debug
793
719794 func_error "missing argument for $1."
720795 exit_cmd=exit
721796 }
722797
798
799 # func_split_short_opt shortopt
800 # Set func_split_short_opt_name and func_split_short_opt_arg shell
801 # variables after splitting SHORTOPT after the 2nd character.
802 func_split_short_opt ()
803 {
804 my_sed_short_opt='1s/^\(..\).*$/\1/;q'
805 my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
806
807 func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
808 func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
809 } # func_split_short_opt may be replaced by extended shell implementation
810
811
812 # func_split_long_opt longopt
813 # Set func_split_long_opt_name and func_split_long_opt_arg shell
814 # variables after splitting LONGOPT at the `=' sign.
815 func_split_long_opt ()
816 {
817 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
818 my_sed_long_arg='1s/^--[^=]*=//'
819
820 func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
821 func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
822 } # func_split_long_opt may be replaced by extended shell implementation
823
723824 exit_cmd=:
724
725825
726826
727827
731831 magic_exe="%%%MAGIC EXE variable%%%"
732832
733833 # Global variables.
734 # $mode is unset
735834 nonopt=
736 execute_dlfiles=
737835 preserve_args=
738836 lo2o="s/\\.lo\$/.${objext}/"
739837 o2lo="s/\\.${objext}\$/.lo/"
740838 extracted_archives=
741839 extracted_serial=0
742840
743 opt_dry_run=false
744 opt_duplicate_deps=false
745 opt_silent=false
746 opt_debug=:
747
748841 # If this variable is set in any of the actions, the command in it
749842 # will be execed at the end. This prevents here-documents from being
750843 # left over by shells.
751844 exec_cmd=
845
846 # func_append var value
847 # Append VALUE to the end of shell variable VAR.
848 func_append ()
849 {
850 eval "${1}=\$${1}\${2}"
851 } # func_append may be replaced by extended shell implementation
852
853 # func_append_quoted var value
854 # Quote VALUE and append to the end of shell variable VAR, separated
855 # by a space.
856 func_append_quoted ()
857 {
858 func_quote_for_eval "${2}"
859 eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
860 } # func_append_quoted may be replaced by extended shell implementation
861
862
863 # func_arith arithmetic-term...
864 func_arith ()
865 {
866 func_arith_result=`expr "${@}"`
867 } # func_arith may be replaced by extended shell implementation
868
869
870 # func_len string
871 # STRING may not start with a hyphen.
872 func_len ()
873 {
874 func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
875 } # func_len may be replaced by extended shell implementation
876
877
878 # func_lo2o object
879 func_lo2o ()
880 {
881 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
882 } # func_lo2o may be replaced by extended shell implementation
883
884
885 # func_xform libobj-or-source
886 func_xform ()
887 {
888 func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
889 } # func_xform may be replaced by extended shell implementation
890
752891
753892 # func_fatal_configuration arg...
754893 # Echo program name prefixed message to standard error, followed by
837976 fi
838977 ;;
839978 esac
840 }
841
842 # Parse options once, thoroughly. This comes as soon as possible in
843 # the script to make things like `libtool --version' happen quickly.
844 {
845
846 # Shorthand for --mode=foo, only valid as the first argument
847 case $1 in
848 clean|clea|cle|cl)
849 shift; set dummy --mode clean ${1+"$@"}; shift
850 ;;
851 compile|compil|compi|comp|com|co|c)
852 shift; set dummy --mode compile ${1+"$@"}; shift
853 ;;
854 execute|execut|execu|exec|exe|ex|e)
855 shift; set dummy --mode execute ${1+"$@"}; shift
856 ;;
857 finish|finis|fini|fin|fi|f)
858 shift; set dummy --mode finish ${1+"$@"}; shift
859 ;;
860 install|instal|insta|inst|ins|in|i)
861 shift; set dummy --mode install ${1+"$@"}; shift
862 ;;
863 link|lin|li|l)
864 shift; set dummy --mode link ${1+"$@"}; shift
865 ;;
866 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
867 shift; set dummy --mode uninstall ${1+"$@"}; shift
868 ;;
869 esac
870
871 # Parse non-mode specific arguments:
872 while test "$#" -gt 0; do
873 opt="$1"
874 shift
875
876 case $opt in
877 --config) func_config ;;
878
879 --debug) preserve_args="$preserve_args $opt"
880 func_echo "enabling shell trace mode"
881 opt_debug='set -x'
882 $opt_debug
883 ;;
884
885 -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
886 execute_dlfiles="$execute_dlfiles $1"
887 shift
888 ;;
889
890 --dry-run | -n) opt_dry_run=: ;;
891 --features) func_features ;;
892 --finish) mode="finish" ;;
893
894 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
895 case $1 in
896 # Valid mode arguments:
897 clean) ;;
898 compile) ;;
899 execute) ;;
900 finish) ;;
901 install) ;;
902 link) ;;
903 relink) ;;
904 uninstall) ;;
905
906 # Catch anything else as an error
907 *) func_error "invalid argument for $opt"
908 exit_cmd=exit
909 break
910 ;;
911 esac
912
913 mode="$1"
914 shift
915 ;;
916
917 --preserve-dup-deps)
918 opt_duplicate_deps=: ;;
919
920 --quiet|--silent) preserve_args="$preserve_args $opt"
921 opt_silent=:
922 opt_verbose=false
923 ;;
924
925 --no-quiet|--no-silent)
926 preserve_args="$preserve_args $opt"
927 opt_silent=false
928 ;;
929
930 --verbose| -v) preserve_args="$preserve_args $opt"
931 opt_silent=false
932 opt_verbose=:
933 ;;
934
935 --no-verbose) preserve_args="$preserve_args $opt"
936 opt_verbose=false
937 ;;
938
939 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
940 preserve_args="$preserve_args $opt $1"
941 func_enable_tag "$1" # tagname is set here
942 shift
943 ;;
944
945 # Separate optargs to long options:
946 -dlopen=*|--mode=*|--tag=*)
947 func_opt_split "$opt"
948 set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
949 shift
950 ;;
951
952 -\?|-h) func_usage ;;
953 --help) opt_help=: ;;
954 --help-all) opt_help=': help-all' ;;
955 --version) func_version ;;
956
957 -*) func_fatal_help "unrecognized option \`$opt'" ;;
958
959 *) nonopt="$opt"
960 break
961 ;;
962 esac
963 done
964
965
966 case $host in
967 *cygwin* | *mingw* | *pw32* | *cegcc*)
968 # don't eliminate duplications in $postdeps and $predeps
969 opt_duplicate_compiler_generated_deps=:
970 ;;
971 *)
972 opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
973 ;;
974 esac
975
976 # Having warned about all mis-specified options, bail out if
977 # anything was wrong.
978 $exit_cmd $EXIT_FAILURE
979979 }
980980
981981 # func_check_version_match
10141014 }
10151015
10161016
1017 # Shorthand for --mode=foo, only valid as the first argument
1018 case $1 in
1019 clean|clea|cle|cl)
1020 shift; set dummy --mode clean ${1+"$@"}; shift
1021 ;;
1022 compile|compil|compi|comp|com|co|c)
1023 shift; set dummy --mode compile ${1+"$@"}; shift
1024 ;;
1025 execute|execut|execu|exec|exe|ex|e)
1026 shift; set dummy --mode execute ${1+"$@"}; shift
1027 ;;
1028 finish|finis|fini|fin|fi|f)
1029 shift; set dummy --mode finish ${1+"$@"}; shift
1030 ;;
1031 install|instal|insta|inst|ins|in|i)
1032 shift; set dummy --mode install ${1+"$@"}; shift
1033 ;;
1034 link|lin|li|l)
1035 shift; set dummy --mode link ${1+"$@"}; shift
1036 ;;
1037 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1038 shift; set dummy --mode uninstall ${1+"$@"}; shift
1039 ;;
1040 esac
1041
1042
1043
1044 # Option defaults:
1045 opt_debug=:
1046 opt_dry_run=false
1047 opt_config=false
1048 opt_preserve_dup_deps=false
1049 opt_features=false
1050 opt_finish=false
1051 opt_help=false
1052 opt_help_all=false
1053 opt_silent=:
1054 opt_verbose=:
1055 opt_silent=false
1056 opt_verbose=false
1057
1058
1059 # Parse options once, thoroughly. This comes as soon as possible in the
1060 # script to make things like `--version' happen as quickly as we can.
1061 {
1062 # this just eases exit handling
1063 while test $# -gt 0; do
1064 opt="$1"
1065 shift
1066 case $opt in
1067 --debug|-x) opt_debug='set -x'
1068 func_echo "enabling shell trace mode"
1069 $opt_debug
1070 ;;
1071 --dry-run|--dryrun|-n)
1072 opt_dry_run=:
1073 ;;
1074 --config)
1075 opt_config=:
1076 func_config
1077 ;;
1078 --dlopen|-dlopen)
1079 optarg="$1"
1080 opt_dlopen="${opt_dlopen+$opt_dlopen
1081 }$optarg"
1082 shift
1083 ;;
1084 --preserve-dup-deps)
1085 opt_preserve_dup_deps=:
1086 ;;
1087 --features)
1088 opt_features=:
1089 func_features
1090 ;;
1091 --finish)
1092 opt_finish=:
1093 set dummy --mode finish ${1+"$@"}; shift
1094 ;;
1095 --help)
1096 opt_help=:
1097 ;;
1098 --help-all)
1099 opt_help_all=:
1100 opt_help=': help-all'
1101 ;;
1102 --mode)
1103 test $# = 0 && func_missing_arg $opt && break
1104 optarg="$1"
1105 opt_mode="$optarg"
1106 case $optarg in
1107 # Valid mode arguments:
1108 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1109
1110 # Catch anything else as an error
1111 *) func_error "invalid argument for $opt"
1112 exit_cmd=exit
1113 break
1114 ;;
1115 esac
1116 shift
1117 ;;
1118 --no-silent|--no-quiet)
1119 opt_silent=false
1120 func_append preserve_args " $opt"
1121 ;;
1122 --no-verbose)
1123 opt_verbose=false
1124 func_append preserve_args " $opt"
1125 ;;
1126 --silent|--quiet)
1127 opt_silent=:
1128 func_append preserve_args " $opt"
1129 opt_verbose=false
1130 ;;
1131 --verbose|-v)
1132 opt_verbose=:
1133 func_append preserve_args " $opt"
1134 opt_silent=false
1135 ;;
1136 --tag)
1137 test $# = 0 && func_missing_arg $opt && break
1138 optarg="$1"
1139 opt_tag="$optarg"
1140 func_append preserve_args " $opt $optarg"
1141 func_enable_tag "$optarg"
1142 shift
1143 ;;
1144
1145 -\?|-h) func_usage ;;
1146 --help) func_help ;;
1147 --version) func_version ;;
1148
1149 # Separate optargs to long options:
1150 --*=*)
1151 func_split_long_opt "$opt"
1152 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1153 shift
1154 ;;
1155
1156 # Separate non-argument short options:
1157 -\?*|-h*|-n*|-v*)
1158 func_split_short_opt "$opt"
1159 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1160 shift
1161 ;;
1162
1163 --) break ;;
1164 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1165 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1166 esac
1167 done
1168
1169 # Validate options:
1170
1171 # save first non-option argument
1172 if test "$#" -gt 0; then
1173 nonopt="$opt"
1174 shift
1175 fi
1176
1177 # preserve --debug
1178 test "$opt_debug" = : || func_append preserve_args " --debug"
1179
1180 case $host in
1181 *cygwin* | *mingw* | *pw32* | *cegcc*)
1182 # don't eliminate duplications in $postdeps and $predeps
1183 opt_duplicate_compiler_generated_deps=:
1184 ;;
1185 *)
1186 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1187 ;;
1188 esac
1189
1190 $opt_help || {
1191 # Sanity checks first:
1192 func_check_version_match
1193
1194 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1195 func_fatal_configuration "not configured to build any kind of library"
1196 fi
1197
1198 # Darwin sucks
1199 eval std_shrext=\"$shrext_cmds\"
1200
1201 # Only execute mode is allowed to have -dlopen flags.
1202 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1203 func_error "unrecognized option \`-dlopen'"
1204 $ECHO "$help" 1>&2
1205 exit $EXIT_FAILURE
1206 fi
1207
1208 # Change the help message to a mode-specific one.
1209 generic_help="$help"
1210 help="Try \`$progname --help --mode=$opt_mode' for more information."
1211 }
1212
1213
1214 # Bail if the options were screwed
1215 $exit_cmd $EXIT_FAILURE
1216 }
1217
1218
1219
1220
10171221 ## ----------- ##
10181222 ## Main. ##
10191223 ## ----------- ##
1020
1021 $opt_help || {
1022 # Sanity checks first:
1023 func_check_version_match
1024
1025 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1026 func_fatal_configuration "not configured to build any kind of library"
1027 fi
1028
1029 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
1030
1031
1032 # Darwin sucks
1033 eval std_shrext=\"$shrext_cmds\"
1034
1035
1036 # Only execute mode is allowed to have -dlopen flags.
1037 if test -n "$execute_dlfiles" && test "$mode" != execute; then
1038 func_error "unrecognized option \`-dlopen'"
1039 $ECHO "$help" 1>&2
1040 exit $EXIT_FAILURE
1041 fi
1042
1043 # Change the help message to a mode-specific one.
1044 generic_help="$help"
1045 help="Try \`$progname --help --mode=$mode' for more information."
1046 }
1047
10481224
10491225 # func_lalib_p file
10501226 # True iff FILE is a libtool `.la' library or `.lo' object file.
11091285 # temporary ltwrapper_script.
11101286 func_ltwrapper_scriptname ()
11111287 {
1112 func_ltwrapper_scriptname_result=""
1113 if func_ltwrapper_executable_p "$1"; then
1114 func_dirname_and_basename "$1" "" "."
1115 func_stripname '' '.exe' "$func_basename_result"
1116 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1117 fi
1288 func_dirname_and_basename "$1" "" "."
1289 func_stripname '' '.exe' "$func_basename_result"
1290 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
11181291 }
11191292
11201293 # func_ltwrapper_p file
11601333 }
11611334
11621335
1336 # func_resolve_sysroot PATH
1337 # Replace a leading = in PATH with a sysroot. Store the result into
1338 # func_resolve_sysroot_result
1339 func_resolve_sysroot ()
1340 {
1341 func_resolve_sysroot_result=$1
1342 case $func_resolve_sysroot_result in
1343 =*)
1344 func_stripname '=' '' "$func_resolve_sysroot_result"
1345 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1346 ;;
1347 esac
1348 }
1349
1350 # func_replace_sysroot PATH
1351 # If PATH begins with the sysroot, replace it with = and
1352 # store the result into func_replace_sysroot_result.
1353 func_replace_sysroot ()
1354 {
1355 case "$lt_sysroot:$1" in
1356 ?*:"$lt_sysroot"*)
1357 func_stripname "$lt_sysroot" '' "$1"
1358 func_replace_sysroot_result="=$func_stripname_result"
1359 ;;
1360 *)
1361 # Including no sysroot.
1362 func_replace_sysroot_result=$1
1363 ;;
1364 esac
1365 }
1366
11631367 # func_infer_tag arg
11641368 # Infer tagged configuration to use if any are available and
11651369 # if one wasn't chosen via the "--tag" command line option.
11721376 if test -n "$available_tags" && test -z "$tagname"; then
11731377 CC_quoted=
11741378 for arg in $CC; do
1175 func_quote_for_eval "$arg"
1176 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1379 func_append_quoted CC_quoted "$arg"
11771380 done
11781381 CC_expanded=`func_echo_all $CC`
11791382 CC_quoted_expanded=`func_echo_all $CC_quoted`
11921395 CC_quoted=
11931396 for arg in $CC; do
11941397 # Double-quote args containing other shell metacharacters.
1195 func_quote_for_eval "$arg"
1196 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1398 func_append_quoted CC_quoted "$arg"
11971399 done
11981400 CC_expanded=`func_echo_all $CC`
11991401 CC_quoted_expanded=`func_echo_all $CC_quoted`
12621464 }
12631465 }
12641466
1467
1468 ##################################################
1469 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1470 ##################################################
1471
1472 # func_convert_core_file_wine_to_w32 ARG
1473 # Helper function used by file name conversion functions when $build is *nix,
1474 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
1475 # correctly configured wine environment available, with the winepath program
1476 # in $build's $PATH.
1477 #
1478 # ARG is the $build file name to be converted to w32 format.
1479 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
1480 # be empty on error (or when ARG is empty)
1481 func_convert_core_file_wine_to_w32 ()
1482 {
1483 $opt_debug
1484 func_convert_core_file_wine_to_w32_result="$1"
1485 if test -n "$1"; then
1486 # Unfortunately, winepath does not exit with a non-zero error code, so we
1487 # are forced to check the contents of stdout. On the other hand, if the
1488 # command is not found, the shell will set an exit code of 127 and print
1489 # *an error message* to stdout. So we must check for both error code of
1490 # zero AND non-empty stdout, which explains the odd construction:
1491 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1492 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1493 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1494 $SED -e "$lt_sed_naive_backslashify"`
1495 else
1496 func_convert_core_file_wine_to_w32_result=
1497 fi
1498 fi
1499 }
1500 # end: func_convert_core_file_wine_to_w32
1501
1502
1503 # func_convert_core_path_wine_to_w32 ARG
1504 # Helper function used by path conversion functions when $build is *nix, and
1505 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1506 # configured wine environment available, with the winepath program in $build's
1507 # $PATH. Assumes ARG has no leading or trailing path separator characters.
1508 #
1509 # ARG is path to be converted from $build format to win32.
1510 # Result is available in $func_convert_core_path_wine_to_w32_result.
1511 # Unconvertible file (directory) names in ARG are skipped; if no directory names
1512 # are convertible, then the result may be empty.
1513 func_convert_core_path_wine_to_w32 ()
1514 {
1515 $opt_debug
1516 # unfortunately, winepath doesn't convert paths, only file names
1517 func_convert_core_path_wine_to_w32_result=""
1518 if test -n "$1"; then
1519 oldIFS=$IFS
1520 IFS=:
1521 for func_convert_core_path_wine_to_w32_f in $1; do
1522 IFS=$oldIFS
1523 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1524 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1525 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1526 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1527 else
1528 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1529 fi
1530 fi
1531 done
1532 IFS=$oldIFS
1533 fi
1534 }
1535 # end: func_convert_core_path_wine_to_w32
1536
1537
1538 # func_cygpath ARGS...
1539 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1540 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1541 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1542 # (2), returns the Cygwin file name or path in func_cygpath_result (input
1543 # file name or path is assumed to be in w32 format, as previously converted
1544 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
1545 # or path in func_cygpath_result (input file name or path is assumed to be in
1546 # Cygwin format). Returns an empty string on error.
1547 #
1548 # ARGS are passed to cygpath, with the last one being the file name or path to
1549 # be converted.
1550 #
1551 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1552 # environment variable; do not put it in $PATH.
1553 func_cygpath ()
1554 {
1555 $opt_debug
1556 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1557 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1558 if test "$?" -ne 0; then
1559 # on failure, ensure result is empty
1560 func_cygpath_result=
1561 fi
1562 else
1563 func_cygpath_result=
1564 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1565 fi
1566 }
1567 #end: func_cygpath
1568
1569
1570 # func_convert_core_msys_to_w32 ARG
1571 # Convert file name or path ARG from MSYS format to w32 format. Return
1572 # result in func_convert_core_msys_to_w32_result.
1573 func_convert_core_msys_to_w32 ()
1574 {
1575 $opt_debug
1576 # awkward: cmd appends spaces to result
1577 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1578 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1579 }
1580 #end: func_convert_core_msys_to_w32
1581
1582
1583 # func_convert_file_check ARG1 ARG2
1584 # Verify that ARG1 (a file name in $build format) was converted to $host
1585 # format in ARG2. Otherwise, emit an error message, but continue (resetting
1586 # func_to_host_file_result to ARG1).
1587 func_convert_file_check ()
1588 {
1589 $opt_debug
1590 if test -z "$2" && test -n "$1" ; then
1591 func_error "Could not determine host file name corresponding to"
1592 func_error " \`$1'"
1593 func_error "Continuing, but uninstalled executables may not work."
1594 # Fallback:
1595 func_to_host_file_result="$1"
1596 fi
1597 }
1598 # end func_convert_file_check
1599
1600
1601 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1602 # Verify that FROM_PATH (a path in $build format) was converted to $host
1603 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1604 # func_to_host_file_result to a simplistic fallback value (see below).
1605 func_convert_path_check ()
1606 {
1607 $opt_debug
1608 if test -z "$4" && test -n "$3"; then
1609 func_error "Could not determine the host path corresponding to"
1610 func_error " \`$3'"
1611 func_error "Continuing, but uninstalled executables may not work."
1612 # Fallback. This is a deliberately simplistic "conversion" and
1613 # should not be "improved". See libtool.info.
1614 if test "x$1" != "x$2"; then
1615 lt_replace_pathsep_chars="s|$1|$2|g"
1616 func_to_host_path_result=`echo "$3" |
1617 $SED -e "$lt_replace_pathsep_chars"`
1618 else
1619 func_to_host_path_result="$3"
1620 fi
1621 fi
1622 }
1623 # end func_convert_path_check
1624
1625
1626 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1627 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1628 # and appending REPL if ORIG matches BACKPAT.
1629 func_convert_path_front_back_pathsep ()
1630 {
1631 $opt_debug
1632 case $4 in
1633 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
1634 ;;
1635 esac
1636 case $4 in
1637 $2 ) func_append func_to_host_path_result "$3"
1638 ;;
1639 esac
1640 }
1641 # end func_convert_path_front_back_pathsep
1642
1643
1644 ##################################################
1645 # $build to $host FILE NAME CONVERSION FUNCTIONS #
1646 ##################################################
1647 # invoked via `$to_host_file_cmd ARG'
1648 #
1649 # In each case, ARG is the path to be converted from $build to $host format.
1650 # Result will be available in $func_to_host_file_result.
1651
1652
1653 # func_to_host_file ARG
1654 # Converts the file name ARG from $build format to $host format. Return result
1655 # in func_to_host_file_result.
1656 func_to_host_file ()
1657 {
1658 $opt_debug
1659 $to_host_file_cmd "$1"
1660 }
1661 # end func_to_host_file
1662
1663
1664 # func_to_tool_file ARG LAZY
1665 # converts the file name ARG from $build format to toolchain format. Return
1666 # result in func_to_tool_file_result. If the conversion in use is listed
1667 # in (the comma separated) LAZY, no conversion takes place.
1668 func_to_tool_file ()
1669 {
1670 $opt_debug
1671 case ,$2, in
1672 *,"$to_tool_file_cmd",*)
1673 func_to_tool_file_result=$1
1674 ;;
1675 *)
1676 $to_tool_file_cmd "$1"
1677 func_to_tool_file_result=$func_to_host_file_result
1678 ;;
1679 esac
1680 }
1681 # end func_to_tool_file
1682
1683
1684 # func_convert_file_noop ARG
1685 # Copy ARG to func_to_host_file_result.
1686 func_convert_file_noop ()
1687 {
1688 func_to_host_file_result="$1"
1689 }
1690 # end func_convert_file_noop
1691
1692
1693 # func_convert_file_msys_to_w32 ARG
1694 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1695 # conversion to w32 is not available inside the cwrapper. Returns result in
1696 # func_to_host_file_result.
1697 func_convert_file_msys_to_w32 ()
1698 {
1699 $opt_debug
1700 func_to_host_file_result="$1"
1701 if test -n "$1"; then
1702 func_convert_core_msys_to_w32 "$1"
1703 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
1704 fi
1705 func_convert_file_check "$1" "$func_to_host_file_result"
1706 }
1707 # end func_convert_file_msys_to_w32
1708
1709
1710 # func_convert_file_cygwin_to_w32 ARG
1711 # Convert file name ARG from Cygwin to w32 format. Returns result in
1712 # func_to_host_file_result.
1713 func_convert_file_cygwin_to_w32 ()
1714 {
1715 $opt_debug
1716 func_to_host_file_result="$1"
1717 if test -n "$1"; then
1718 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1719 # LT_CYGPATH in this case.
1720 func_to_host_file_result=`cygpath -m "$1"`
1721 fi
1722 func_convert_file_check "$1" "$func_to_host_file_result"
1723 }
1724 # end func_convert_file_cygwin_to_w32
1725
1726
1727 # func_convert_file_nix_to_w32 ARG
1728 # Convert file name ARG from *nix to w32 format. Requires a wine environment
1729 # and a working winepath. Returns result in func_to_host_file_result.
1730 func_convert_file_nix_to_w32 ()
1731 {
1732 $opt_debug
1733 func_to_host_file_result="$1"
1734 if test -n "$1"; then
1735 func_convert_core_file_wine_to_w32 "$1"
1736 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
1737 fi
1738 func_convert_file_check "$1" "$func_to_host_file_result"
1739 }
1740 # end func_convert_file_nix_to_w32
1741
1742
1743 # func_convert_file_msys_to_cygwin ARG
1744 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1745 # Returns result in func_to_host_file_result.
1746 func_convert_file_msys_to_cygwin ()
1747 {
1748 $opt_debug
1749 func_to_host_file_result="$1"
1750 if test -n "$1"; then
1751 func_convert_core_msys_to_w32 "$1"
1752 func_cygpath -u "$func_convert_core_msys_to_w32_result"
1753 func_to_host_file_result="$func_cygpath_result"
1754 fi
1755 func_convert_file_check "$1" "$func_to_host_file_result"
1756 }
1757 # end func_convert_file_msys_to_cygwin
1758
1759
1760 # func_convert_file_nix_to_cygwin ARG
1761 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
1762 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
1763 # in func_to_host_file_result.
1764 func_convert_file_nix_to_cygwin ()
1765 {
1766 $opt_debug
1767 func_to_host_file_result="$1"
1768 if test -n "$1"; then
1769 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1770 func_convert_core_file_wine_to_w32 "$1"
1771 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1772 func_to_host_file_result="$func_cygpath_result"
1773 fi
1774 func_convert_file_check "$1" "$func_to_host_file_result"
1775 }
1776 # end func_convert_file_nix_to_cygwin
1777
1778
1779 #############################################
1780 # $build to $host PATH CONVERSION FUNCTIONS #
1781 #############################################
1782 # invoked via `$to_host_path_cmd ARG'
1783 #
1784 # In each case, ARG is the path to be converted from $build to $host format.
1785 # The result will be available in $func_to_host_path_result.
1786 #
1787 # Path separators are also converted from $build format to $host format. If
1788 # ARG begins or ends with a path separator character, it is preserved (but
1789 # converted to $host format) on output.
1790 #
1791 # All path conversion functions are named using the following convention:
1792 # file name conversion function : func_convert_file_X_to_Y ()
1793 # path conversion function : func_convert_path_X_to_Y ()
1794 # where, for any given $build/$host combination the 'X_to_Y' value is the
1795 # same. If conversion functions are added for new $build/$host combinations,
1796 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
1797 # will break.
1798
1799
1800 # func_init_to_host_path_cmd
1801 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
1802 # appropriate value, based on the value of $to_host_file_cmd.
1803 to_host_path_cmd=
1804 func_init_to_host_path_cmd ()
1805 {
1806 $opt_debug
1807 if test -z "$to_host_path_cmd"; then
1808 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1809 to_host_path_cmd="func_convert_path_${func_stripname_result}"
1810 fi
1811 }
1812
1813
1814 # func_to_host_path ARG
1815 # Converts the path ARG from $build format to $host format. Return result
1816 # in func_to_host_path_result.
1817 func_to_host_path ()
1818 {
1819 $opt_debug
1820 func_init_to_host_path_cmd
1821 $to_host_path_cmd "$1"
1822 }
1823 # end func_to_host_path
1824
1825
1826 # func_convert_path_noop ARG
1827 # Copy ARG to func_to_host_path_result.
1828 func_convert_path_noop ()
1829 {
1830 func_to_host_path_result="$1"
1831 }
1832 # end func_convert_path_noop
1833
1834
1835 # func_convert_path_msys_to_w32 ARG
1836 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1837 # conversion to w32 is not available inside the cwrapper. Returns result in
1838 # func_to_host_path_result.
1839 func_convert_path_msys_to_w32 ()
1840 {
1841 $opt_debug
1842 func_to_host_path_result="$1"
1843 if test -n "$1"; then
1844 # Remove leading and trailing path separator characters from ARG. MSYS
1845 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1846 # and winepath ignores them completely.
1847 func_stripname : : "$1"
1848 func_to_host_path_tmp1=$func_stripname_result
1849 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1850 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
1851 func_convert_path_check : ";" \
1852 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1853 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1854 fi
1855 }
1856 # end func_convert_path_msys_to_w32
1857
1858
1859 # func_convert_path_cygwin_to_w32 ARG
1860 # Convert path ARG from Cygwin to w32 format. Returns result in
1861 # func_to_host_file_result.
1862 func_convert_path_cygwin_to_w32 ()
1863 {
1864 $opt_debug
1865 func_to_host_path_result="$1"
1866 if test -n "$1"; then
1867 # See func_convert_path_msys_to_w32:
1868 func_stripname : : "$1"
1869 func_to_host_path_tmp1=$func_stripname_result
1870 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1871 func_convert_path_check : ";" \
1872 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1873 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1874 fi
1875 }
1876 # end func_convert_path_cygwin_to_w32
1877
1878
1879 # func_convert_path_nix_to_w32 ARG
1880 # Convert path ARG from *nix to w32 format. Requires a wine environment and
1881 # a working winepath. Returns result in func_to_host_file_result.
1882 func_convert_path_nix_to_w32 ()
1883 {
1884 $opt_debug
1885 func_to_host_path_result="$1"
1886 if test -n "$1"; then
1887 # See func_convert_path_msys_to_w32:
1888 func_stripname : : "$1"
1889 func_to_host_path_tmp1=$func_stripname_result
1890 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1891 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
1892 func_convert_path_check : ";" \
1893 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1894 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1895 fi
1896 }
1897 # end func_convert_path_nix_to_w32
1898
1899
1900 # func_convert_path_msys_to_cygwin ARG
1901 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1902 # Returns result in func_to_host_file_result.
1903 func_convert_path_msys_to_cygwin ()
1904 {
1905 $opt_debug
1906 func_to_host_path_result="$1"
1907 if test -n "$1"; then
1908 # See func_convert_path_msys_to_w32:
1909 func_stripname : : "$1"
1910 func_to_host_path_tmp1=$func_stripname_result
1911 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1912 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1913 func_to_host_path_result="$func_cygpath_result"
1914 func_convert_path_check : : \
1915 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1916 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1917 fi
1918 }
1919 # end func_convert_path_msys_to_cygwin
1920
1921
1922 # func_convert_path_nix_to_cygwin ARG
1923 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
1924 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
1925 # func_to_host_file_result.
1926 func_convert_path_nix_to_cygwin ()
1927 {
1928 $opt_debug
1929 func_to_host_path_result="$1"
1930 if test -n "$1"; then
1931 # Remove leading and trailing path separator characters from
1932 # ARG. msys behavior is inconsistent here, cygpath turns them
1933 # into '.;' and ';.', and winepath ignores them completely.
1934 func_stripname : : "$1"
1935 func_to_host_path_tmp1=$func_stripname_result
1936 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1937 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1938 func_to_host_path_result="$func_cygpath_result"
1939 func_convert_path_check : : \
1940 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1941 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1942 fi
1943 }
1944 # end func_convert_path_nix_to_cygwin
1945
1946
12651947 # func_mode_compile arg...
12661948 func_mode_compile ()
12671949 {
13021984 ;;
13031985
13041986 -pie | -fpie | -fPIE)
1305 pie_flag="$pie_flag $arg"
1987 func_append pie_flag " $arg"
13061988 continue
13071989 ;;
13081990
13091991 -shared | -static | -prefer-pic | -prefer-non-pic)
1310 later="$later $arg"
1992 func_append later " $arg"
13111993 continue
13121994 ;;
13131995
13282010 save_ifs="$IFS"; IFS=','
13292011 for arg in $args; do
13302012 IFS="$save_ifs"
1331 func_quote_for_eval "$arg"
1332 lastarg="$lastarg $func_quote_for_eval_result"
2013 func_append_quoted lastarg "$arg"
13332014 done
13342015 IFS="$save_ifs"
13352016 func_stripname ' ' '' "$lastarg"
13362017 lastarg=$func_stripname_result
13372018
13382019 # Add the arguments to base_compile.
1339 base_compile="$base_compile $lastarg"
2020 func_append base_compile " $lastarg"
13402021 continue
13412022 ;;
13422023
13522033 esac # case $arg_mode
13532034
13542035 # Aesthetically quote the previous argument.
1355 func_quote_for_eval "$lastarg"
1356 base_compile="$base_compile $func_quote_for_eval_result"
2036 func_append_quoted base_compile "$lastarg"
13572037 done # for arg
13582038
13592039 case $arg_mode in
14842164 $opt_dry_run || $RM $removelist
14852165 exit $EXIT_FAILURE
14862166 fi
1487 removelist="$removelist $output_obj"
2167 func_append removelist " $output_obj"
14882168 $ECHO "$srcfile" > "$lockfile"
14892169 fi
14902170
14912171 $opt_dry_run || $RM $removelist
1492 removelist="$removelist $lockfile"
2172 func_append removelist " $lockfile"
14932173 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
14942174
1495 if test -n "$fix_srcfile_path"; then
1496 eval srcfile=\"$fix_srcfile_path\"
1497 fi
2175 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2176 srcfile=$func_to_tool_file_result
14982177 func_quote_for_eval "$srcfile"
14992178 qsrcfile=$func_quote_for_eval_result
15002179
15142193
15152194 if test -z "$output_obj"; then
15162195 # Place PIC objects in $objdir
1517 command="$command -o $lobj"
2196 func_append command " -o $lobj"
15182197 fi
15192198
15202199 func_show_eval_locale "$command" \
15612240 command="$base_compile $qsrcfile $pic_flag"
15622241 fi
15632242 if test "$compiler_c_o" = yes; then
1564 command="$command -o $obj"
2243 func_append command " -o $obj"
15652244 fi
15662245
15672246 # Suppress compiler output if we already did a PIC compilation.
1568 command="$command$suppress_output"
2247 func_append command "$suppress_output"
15692248 func_show_eval_locale "$command" \
15702249 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
15712250
16102289 }
16112290
16122291 $opt_help || {
1613 test "$mode" = compile && func_mode_compile ${1+"$@"}
2292 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
16142293 }
16152294
16162295 func_mode_help ()
16172296 {
16182297 # We need to display help for each of the modes.
1619 case $mode in
2298 case $opt_mode in
16202299 "")
16212300 # Generic help is extracted from the usage comments
16222301 # at the start of this file.
17922471 ;;
17932472
17942473 *)
1795 func_fatal_help "invalid operation mode \`$mode'"
2474 func_fatal_help "invalid operation mode \`$opt_mode'"
17962475 ;;
17972476 esac
17982477
18072486 else
18082487 {
18092488 func_help noexit
1810 for mode in compile link execute install finish uninstall clean; do
2489 for opt_mode in compile link execute install finish uninstall clean; do
18112490 func_mode_help
18122491 done
18132492 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
18142493 {
18152494 func_help noexit
1816 for mode in compile link execute install finish uninstall clean; do
2495 for opt_mode in compile link execute install finish uninstall clean; do
18172496 echo
18182497 func_mode_help
18192498 done
18422521 func_fatal_help "you must specify a COMMAND"
18432522
18442523 # Handle -dlopen flags immediately.
1845 for file in $execute_dlfiles; do
2524 for file in $opt_dlopen; do
18462525 test -f "$file" \
18472526 || func_fatal_help "\`$file' is not a file"
18482527
18492528 dir=
18502529 case $file in
18512530 *.la)
2531 func_resolve_sysroot "$file"
2532 file=$func_resolve_sysroot_result
2533
18522534 # Check to see that this really is a libtool archive.
18532535 func_lalib_unsafe_p "$file" \
18542536 || func_fatal_help "\`$lib' is not a valid libtool archive"
18702552 dir="$func_dirname_result"
18712553
18722554 if test -f "$dir/$objdir/$dlname"; then
1873 dir="$dir/$objdir"
2555 func_append dir "/$objdir"
18742556 else
18752557 if test ! -f "$dir/$dlname"; then
18762558 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
19272609 ;;
19282610 esac
19292611 # Quote arguments (to preserve shell metacharacters).
1930 func_quote_for_eval "$file"
1931 args="$args $func_quote_for_eval_result"
2612 func_append_quoted args "$file"
19322613 done
19332614
19342615 if test "X$opt_dry_run" = Xfalse; then
19602641 fi
19612642 }
19622643
1963 test "$mode" = execute && func_mode_execute ${1+"$@"}
2644 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
19642645
19652646
19662647 # func_mode_finish arg...
19672648 func_mode_finish ()
19682649 {
19692650 $opt_debug
1970 libdirs="$nonopt"
2651 libs=
2652 libdirs=
19712653 admincmds=
19722654
2655 for opt in "$nonopt" ${1+"$@"}
2656 do
2657 if test -d "$opt"; then
2658 func_append libdirs " $opt"
2659
2660 elif test -f "$opt"; then
2661 if func_lalib_unsafe_p "$opt"; then
2662 func_append libs " $opt"
2663 else
2664 func_warning "\`$opt' is not a valid libtool archive"
2665 fi
2666
2667 else
2668 func_fatal_error "invalid argument \`$opt'"
2669 fi
2670 done
2671
2672 if test -n "$libs"; then
2673 if test -n "$lt_sysroot"; then
2674 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
2675 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
2676 else
2677 sysroot_cmd=
2678 fi
2679
2680 # Remove sysroot references
2681 if $opt_dry_run; then
2682 for lib in $libs; do
2683 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
2684 done
2685 else
2686 tmpdir=`func_mktempdir`
2687 for lib in $libs; do
2688 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
2689 > $tmpdir/tmp-la
2690 mv -f $tmpdir/tmp-la $lib
2691 done
2692 ${RM}r "$tmpdir"
2693 fi
2694 fi
2695
19732696 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1974 for dir
1975 do
1976 libdirs="$libdirs $dir"
1977 done
1978
19792697 for libdir in $libdirs; do
19802698 if test -n "$finish_cmds"; then
19812699 # Do each command in the finish commands.
19852703 if test -n "$finish_eval"; then
19862704 # Do the single finish_eval.
19872705 eval cmds=\"$finish_eval\"
1988 $opt_dry_run || eval "$cmds" || admincmds="$admincmds
2706 $opt_dry_run || eval "$cmds" || func_append admincmds "
19892707 $cmds"
19902708 fi
19912709 done
19942712 # Exit here if they wanted silent mode.
19952713 $opt_silent && exit $EXIT_SUCCESS
19962714
1997 echo "----------------------------------------------------------------------"
1998 echo "Libraries have been installed in:"
1999 for libdir in $libdirs; do
2000 $ECHO " $libdir"
2001 done
2002 echo
2003 echo "If you ever happen to want to link against installed libraries"
2004 echo "in a given directory, LIBDIR, you must either use libtool, and"
2005 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2006 echo "flag during linking and do at least one of the following:"
2007 if test -n "$shlibpath_var"; then
2008 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2009 echo " during execution"
2715 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2716 echo "----------------------------------------------------------------------"
2717 echo "Libraries have been installed in:"
2718 for libdir in $libdirs; do
2719 $ECHO " $libdir"
2720 done
2721 echo
2722 echo "If you ever happen to want to link against installed libraries"
2723 echo "in a given directory, LIBDIR, you must either use libtool, and"
2724 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2725 echo "flag during linking and do at least one of the following:"
2726 if test -n "$shlibpath_var"; then
2727 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2728 echo " during execution"
2729 fi
2730 if test -n "$runpath_var"; then
2731 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2732 echo " during linking"
2733 fi
2734 if test -n "$hardcode_libdir_flag_spec"; then
2735 libdir=LIBDIR
2736 eval flag=\"$hardcode_libdir_flag_spec\"
2737
2738 $ECHO " - use the \`$flag' linker flag"
2739 fi
2740 if test -n "$admincmds"; then
2741 $ECHO " - have your system administrator run these commands:$admincmds"
2742 fi
2743 if test -f /etc/ld.so.conf; then
2744 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2745 fi
2746 echo
2747
2748 echo "See any operating system documentation about shared libraries for"
2749 case $host in
2750 solaris2.[6789]|solaris2.1[0-9])
2751 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2752 echo "pages."
2753 ;;
2754 *)
2755 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2756 ;;
2757 esac
2758 echo "----------------------------------------------------------------------"
20102759 fi
2011 if test -n "$runpath_var"; then
2012 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2013 echo " during linking"
2014 fi
2015 if test -n "$hardcode_libdir_flag_spec"; then
2016 libdir=LIBDIR
2017 eval flag=\"$hardcode_libdir_flag_spec\"
2018
2019 $ECHO " - use the \`$flag' linker flag"
2020 fi
2021 if test -n "$admincmds"; then
2022 $ECHO " - have your system administrator run these commands:$admincmds"
2023 fi
2024 if test -f /etc/ld.so.conf; then
2025 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2026 fi
2027 echo
2028
2029 echo "See any operating system documentation about shared libraries for"
2030 case $host in
2031 solaris2.[6789]|solaris2.1[0-9])
2032 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2033 echo "pages."
2034 ;;
2035 *)
2036 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2037 ;;
2038 esac
2039 echo "----------------------------------------------------------------------"
20402760 exit $EXIT_SUCCESS
20412761 }
20422762
2043 test "$mode" = finish && func_mode_finish ${1+"$@"}
2763 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
20442764
20452765
20462766 # func_mode_install arg...
20652785 # The real first argument should be the name of the installation program.
20662786 # Aesthetically quote it.
20672787 func_quote_for_eval "$arg"
2068 install_prog="$install_prog$func_quote_for_eval_result"
2788 func_append install_prog "$func_quote_for_eval_result"
20692789 install_shared_prog=$install_prog
20702790 case " $install_prog " in
20712791 *[\\\ /]cp\ *) install_cp=: ;;
20852805 do
20862806 arg2=
20872807 if test -n "$dest"; then
2088 files="$files $dest"
2808 func_append files " $dest"
20892809 dest=$arg
20902810 continue
20912811 fi
21232843
21242844 # Aesthetically quote the argument.
21252845 func_quote_for_eval "$arg"
2126 install_prog="$install_prog $func_quote_for_eval_result"
2846 func_append install_prog " $func_quote_for_eval_result"
21272847 if test -n "$arg2"; then
21282848 func_quote_for_eval "$arg2"
21292849 fi
2130 install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
2850 func_append install_shared_prog " $func_quote_for_eval_result"
21312851 done
21322852
21332853 test -z "$install_prog" && \
21392859 if test -n "$install_override_mode" && $no_mode; then
21402860 if $install_cp; then :; else
21412861 func_quote_for_eval "$install_override_mode"
2142 install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
2862 func_append install_shared_prog " -m $func_quote_for_eval_result"
21432863 fi
21442864 fi
21452865
21972917 case $file in
21982918 *.$libext)
21992919 # Do the static libraries later.
2200 staticlibs="$staticlibs $file"
2920 func_append staticlibs " $file"
22012921 ;;
22022922
22032923 *.la)
2924 func_resolve_sysroot "$file"
2925 file=$func_resolve_sysroot_result
2926
22042927 # Check to see that this really is a libtool archive.
22052928 func_lalib_unsafe_p "$file" \
22062929 || func_fatal_help "\`$file' is not a valid libtool archive"
22142937 if test "X$destdir" = "X$libdir"; then
22152938 case "$current_libdirs " in
22162939 *" $libdir "*) ;;
2217 *) current_libdirs="$current_libdirs $libdir" ;;
2940 *) func_append current_libdirs " $libdir" ;;
22182941 esac
22192942 else
22202943 # Note the libdir as a future libdir.
22212944 case "$future_libdirs " in
22222945 *" $libdir "*) ;;
2223 *) future_libdirs="$future_libdirs $libdir" ;;
2946 *) func_append future_libdirs " $libdir" ;;
22242947 esac
22252948 fi
22262949
22272950 func_dirname "$file" "/" ""
22282951 dir="$func_dirname_result"
2229 dir="$dir$objdir"
2952 func_append dir "$objdir"
22302953
22312954 if test -n "$relink_command"; then
22322955 # Determine the prefix the user has applied to our future dir.
23033026 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
23043027
23053028 # Maybe install the static library, too.
2306 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3029 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
23073030 ;;
23083031
23093032 *.lo)
25003223 fi
25013224 }
25023225
2503 test "$mode" = install && func_mode_install ${1+"$@"}
3226 test "$opt_mode" = install && func_mode_install ${1+"$@"}
25043227
25053228
25063229 # func_generate_dlsyms outputname originator pic_p
25473270 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
25483271 #endif
25493272
3273 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3274 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3275 /* DATA imports from DLLs on WIN32 con't be const, because runtime
3276 relocations are performed -- see ld's documentation on pseudo-relocs. */
3277 # define LT_DLSYM_CONST
3278 #elif defined(__osf__)
3279 /* This system does not cope well with relocations in const data. */
3280 # define LT_DLSYM_CONST
3281 #else
3282 # define LT_DLSYM_CONST const
3283 #endif
3284
25503285 /* External symbol declarations for the compiler. */\
25513286 "
25523287
25583293 # Add our own program objects to the symbol list.
25593294 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
25603295 for progfile in $progfiles; do
2561 func_verbose "extracting global C symbols from \`$progfile'"
2562 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
3296 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3297 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3298 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
25633299 done
25643300
25653301 if test -n "$exclude_expsyms"; then
26083344 func_verbose "extracting global C symbols from \`$dlprefile'"
26093345 func_basename "$dlprefile"
26103346 name="$func_basename_result"
2611 $opt_dry_run || {
2612 eval '$ECHO ": $name " >> "$nlist"'
2613 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2614 }
3347 case $host in
3348 *cygwin* | *mingw* | *cegcc* )
3349 # if an import library, we need to obtain dlname
3350 if func_win32_import_lib_p "$dlprefile"; then
3351 func_tr_sh "$dlprefile"
3352 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3353 dlprefile_dlbasename=""
3354 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3355 # Use subshell, to avoid clobbering current variable values
3356 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3357 if test -n "$dlprefile_dlname" ; then
3358 func_basename "$dlprefile_dlname"
3359 dlprefile_dlbasename="$func_basename_result"
3360 else
3361 # no lafile. user explicitly requested -dlpreopen <import library>.
3362 $sharedlib_from_linklib_cmd "$dlprefile"
3363 dlprefile_dlbasename=$sharedlib_from_linklib_result
3364 fi
3365 fi
3366 $opt_dry_run || {
3367 if test -n "$dlprefile_dlbasename" ; then
3368 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3369 else
3370 func_warning "Could not compute DLL name from $name"
3371 eval '$ECHO ": $name " >> "$nlist"'
3372 fi
3373 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3374 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3375 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3376 }
3377 else # not an import lib
3378 $opt_dry_run || {
3379 eval '$ECHO ": $name " >> "$nlist"'
3380 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3381 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3382 }
3383 fi
3384 ;;
3385 *)
3386 $opt_dry_run || {
3387 eval '$ECHO ": $name " >> "$nlist"'
3388 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3389 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3390 }
3391 ;;
3392 esac
26153393 done
26163394
26173395 $opt_dry_run || {
26493427 const char *name;
26503428 void *address;
26513429 } lt_dlsymlist;
2652 "
2653 case $host in
2654 *cygwin* | *mingw* | *cegcc* )
2655 echo >> "$output_objdir/$my_dlsyms" "\
2656 /* DATA imports from DLLs on WIN32 con't be const, because
2657 runtime relocations are performed -- see ld's documentation
2658 on pseudo-relocs. */"
2659 lt_dlsym_const= ;;
2660 *osf5*)
2661 echo >> "$output_objdir/$my_dlsyms" "\
2662 /* This system does not cope well with relocations in const data */"
2663 lt_dlsym_const= ;;
2664 *)
2665 lt_dlsym_const=const ;;
2666 esac
2667
2668 echo >> "$output_objdir/$my_dlsyms" "\
2669 extern $lt_dlsym_const lt_dlsymlist
3430 extern LT_DLSYM_CONST lt_dlsymlist
26703431 lt_${my_prefix}_LTX_preloaded_symbols[];
2671 $lt_dlsym_const lt_dlsymlist
3432 LT_DLSYM_CONST lt_dlsymlist
26723433 lt_${my_prefix}_LTX_preloaded_symbols[] =
26733434 {\
26743435 { \"$my_originator\", (void *) 0 },"
27243485 for arg in $LTCFLAGS; do
27253486 case $arg in
27263487 -pie | -fpie | -fPIE) ;;
2727 *) symtab_cflags="$symtab_cflags $arg" ;;
3488 *) func_append symtab_cflags " $arg" ;;
27283489 esac
27293490 done
27303491
27873548 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
27883549 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
27893550 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
2790 win32_nmres=`eval $NM -f posix -A $1 |
3551 func_to_tool_file "$1" func_convert_file_msys_to_w32
3552 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
27913553 $SED -n -e '
27923554 1,100{
27933555 / I /{
28163578 $ECHO "$win32_libid_type"
28173579 }
28183580
3581 # func_cygming_dll_for_implib ARG
3582 #
3583 # Platform-specific function to extract the
3584 # name of the DLL associated with the specified
3585 # import library ARG.
3586 # Invoked by eval'ing the libtool variable
3587 # $sharedlib_from_linklib_cmd
3588 # Result is available in the variable
3589 # $sharedlib_from_linklib_result
3590 func_cygming_dll_for_implib ()
3591 {
3592 $opt_debug
3593 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3594 }
3595
3596 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3597 #
3598 # The is the core of a fallback implementation of a
3599 # platform-specific function to extract the name of the
3600 # DLL associated with the specified import library LIBNAME.
3601 #
3602 # SECTION_NAME is either .idata$6 or .idata$7, depending
3603 # on the platform and compiler that created the implib.
3604 #
3605 # Echos the name of the DLL associated with the
3606 # specified import library.
3607 func_cygming_dll_for_implib_fallback_core ()
3608 {
3609 $opt_debug
3610 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3611 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3612 $SED '/^Contents of section '"$match_literal"':/{
3613 # Place marker at beginning of archive member dllname section
3614 s/.*/====MARK====/
3615 p
3616 d
3617 }
3618 # These lines can sometimes be longer than 43 characters, but
3619 # are always uninteresting
3620 /:[ ]*file format pe[i]\{,1\}-/d
3621 /^In archive [^:]*:/d
3622 # Ensure marker is printed
3623 /^====MARK====/p
3624 # Remove all lines with less than 43 characters
3625 /^.\{43\}/!d
3626 # From remaining lines, remove first 43 characters
3627 s/^.\{43\}//' |
3628 $SED -n '
3629 # Join marker and all lines until next marker into a single line
3630 /^====MARK====/ b para
3631 H
3632 $ b para
3633 b
3634 :para
3635 x
3636 s/\n//g
3637 # Remove the marker
3638 s/^====MARK====//
3639 # Remove trailing dots and whitespace
3640 s/[\. \t]*$//
3641 # Print
3642 /./p' |
3643 # we now have a list, one entry per line, of the stringified
3644 # contents of the appropriate section of all members of the
3645 # archive which possess that section. Heuristic: eliminate
3646 # all those which have a first or second character that is
3647 # a '.' (that is, objdump's representation of an unprintable
3648 # character.) This should work for all archives with less than
3649 # 0x302f exports -- but will fail for DLLs whose name actually
3650 # begins with a literal '.' or a single character followed by
3651 # a '.'.
3652 #
3653 # Of those that remain, print the first one.
3654 $SED -e '/^\./d;/^.\./d;q'
3655 }
3656
3657 # func_cygming_gnu_implib_p ARG
3658 # This predicate returns with zero status (TRUE) if
3659 # ARG is a GNU/binutils-style import library. Returns
3660 # with nonzero status (FALSE) otherwise.
3661 func_cygming_gnu_implib_p ()
3662 {
3663 $opt_debug
3664 func_to_tool_file "$1" func_convert_file_msys_to_w32
3665 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)$'`
3666 test -n "$func_cygming_gnu_implib_tmp"
3667 }
3668
3669 # func_cygming_ms_implib_p ARG
3670 # This predicate returns with zero status (TRUE) if
3671 # ARG is an MS-style import library. Returns
3672 # with nonzero status (FALSE) otherwise.
3673 func_cygming_ms_implib_p ()
3674 {
3675 $opt_debug
3676 func_to_tool_file "$1" func_convert_file_msys_to_w32
3677 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3678 test -n "$func_cygming_ms_implib_tmp"
3679 }
3680
3681 # func_cygming_dll_for_implib_fallback ARG
3682 # Platform-specific function to extract the
3683 # name of the DLL associated with the specified
3684 # import library ARG.
3685 #
3686 # This fallback implementation is for use when $DLLTOOL
3687 # does not support the --identify-strict option.
3688 # Invoked by eval'ing the libtool variable
3689 # $sharedlib_from_linklib_cmd
3690 # Result is available in the variable
3691 # $sharedlib_from_linklib_result
3692 func_cygming_dll_for_implib_fallback ()
3693 {
3694 $opt_debug
3695 if func_cygming_gnu_implib_p "$1" ; then
3696 # binutils import library
3697 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3698 elif func_cygming_ms_implib_p "$1" ; then
3699 # ms-generated import library
3700 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3701 else
3702 # unknown
3703 sharedlib_from_linklib_result=""
3704 fi
3705 }
28193706
28203707
28213708 # func_extract_an_archive dir oldlib
31944081
31954082 if test -f \"\$progdir/\$program\"; then"
31964083
4084 # fixup the dll searchpath if we need to.
4085 #
4086 # Fix the DLL searchpath if we need to. Do this before prepending
4087 # to shlibpath, because on Windows, both are PATH and uninstalled
4088 # libraries must come first.
4089 if test -n "$dllsearchpath"; then
4090 $ECHO "\
4091 # Add the dll search path components to the executable PATH
4092 PATH=$dllsearchpath:\$PATH
4093 "
4094 fi
4095
31974096 # Export our shlibpath_var if we have one.
31984097 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
31994098 $ECHO "\
32054104 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
32064105
32074106 export $shlibpath_var
3208 "
3209 fi
3210
3211 # fixup the dll searchpath if we need to.
3212 if test -n "$dllsearchpath"; then
3213 $ECHO "\
3214 # Add the dll search path components to the executable PATH
3215 PATH=$dllsearchpath:\$PATH
32164107 "
32174108 fi
32184109
32324123 "
32334124 }
32344125
3235
3236 # func_to_host_path arg
3237 #
3238 # Convert paths to host format when used with build tools.
3239 # Intended for use with "native" mingw (where libtool itself
3240 # is running under the msys shell), or in the following cross-
3241 # build environments:
3242 # $build $host
3243 # mingw (msys) mingw [e.g. native]
3244 # cygwin mingw
3245 # *nix + wine mingw
3246 # where wine is equipped with the `winepath' executable.
3247 # In the native mingw case, the (msys) shell automatically
3248 # converts paths for any non-msys applications it launches,
3249 # but that facility isn't available from inside the cwrapper.
3250 # Similar accommodations are necessary for $host mingw and
3251 # $build cygwin. Calling this function does no harm for other
3252 # $host/$build combinations not listed above.
3253 #
3254 # ARG is the path (on $build) that should be converted to
3255 # the proper representation for $host. The result is stored
3256 # in $func_to_host_path_result.
3257 func_to_host_path ()
3258 {
3259 func_to_host_path_result="$1"
3260 if test -n "$1"; then
3261 case $host in
3262 *mingw* )
3263 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3264 case $build in
3265 *mingw* ) # actually, msys
3266 # awkward: cmd appends spaces to result
3267 func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
3268 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3269 ;;
3270 *cygwin* )
3271 func_to_host_path_result=`cygpath -w "$1" |
3272 $SED -e "$lt_sed_naive_backslashify"`
3273 ;;
3274 * )
3275 # Unfortunately, winepath does not exit with a non-zero
3276 # error code, so we are forced to check the contents of
3277 # stdout. On the other hand, if the command is not
3278 # found, the shell will set an exit code of 127 and print
3279 # *an error message* to stdout. So we must check for both
3280 # error code of zero AND non-empty stdout, which explains
3281 # the odd construction:
3282 func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3283 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3284 func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
3285 $SED -e "$lt_sed_naive_backslashify"`
3286 else
3287 # Allow warning below.
3288 func_to_host_path_result=
3289 fi
3290 ;;
3291 esac
3292 if test -z "$func_to_host_path_result" ; then
3293 func_error "Could not determine host path corresponding to"
3294 func_error " \`$1'"
3295 func_error "Continuing, but uninstalled executables may not work."
3296 # Fallback:
3297 func_to_host_path_result="$1"
3298 fi
3299 ;;
3300 esac
3301 fi
3302 }
3303 # end: func_to_host_path
3304
3305 # func_to_host_pathlist arg
3306 #
3307 # Convert pathlists to host format when used with build tools.
3308 # See func_to_host_path(), above. This function supports the
3309 # following $build/$host combinations (but does no harm for
3310 # combinations not listed here):
3311 # $build $host
3312 # mingw (msys) mingw [e.g. native]
3313 # cygwin mingw
3314 # *nix + wine mingw
3315 #
3316 # Path separators are also converted from $build format to
3317 # $host format. If ARG begins or ends with a path separator
3318 # character, it is preserved (but converted to $host format)
3319 # on output.
3320 #
3321 # ARG is a pathlist (on $build) that should be converted to
3322 # the proper representation on $host. The result is stored
3323 # in $func_to_host_pathlist_result.
3324 func_to_host_pathlist ()
3325 {
3326 func_to_host_pathlist_result="$1"
3327 if test -n "$1"; then
3328 case $host in
3329 *mingw* )
3330 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3331 # Remove leading and trailing path separator characters from
3332 # ARG. msys behavior is inconsistent here, cygpath turns them
3333 # into '.;' and ';.', and winepath ignores them completely.
3334 func_stripname : : "$1"
3335 func_to_host_pathlist_tmp1=$func_stripname_result
3336 case $build in
3337 *mingw* ) # Actually, msys.
3338 # Awkward: cmd appends spaces to result.
3339 func_to_host_pathlist_result=`
3340 ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
3341 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3342 ;;
3343 *cygwin* )
3344 func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
3345 $SED -e "$lt_sed_naive_backslashify"`
3346 ;;
3347 * )
3348 # unfortunately, winepath doesn't convert pathlists
3349 func_to_host_pathlist_result=""
3350 func_to_host_pathlist_oldIFS=$IFS
3351 IFS=:
3352 for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
3353 IFS=$func_to_host_pathlist_oldIFS
3354 if test -n "$func_to_host_pathlist_f" ; then
3355 func_to_host_path "$func_to_host_pathlist_f"
3356 if test -n "$func_to_host_path_result" ; then
3357 if test -z "$func_to_host_pathlist_result" ; then
3358 func_to_host_pathlist_result="$func_to_host_path_result"
3359 else
3360 func_append func_to_host_pathlist_result ";$func_to_host_path_result"
3361 fi
3362 fi
3363 fi
3364 done
3365 IFS=$func_to_host_pathlist_oldIFS
3366 ;;
3367 esac
3368 if test -z "$func_to_host_pathlist_result"; then
3369 func_error "Could not determine the host path(s) corresponding to"
3370 func_error " \`$1'"
3371 func_error "Continuing, but uninstalled executables may not work."
3372 # Fallback. This may break if $1 contains DOS-style drive
3373 # specifications. The fix is not to complicate the expression
3374 # below, but for the user to provide a working wine installation
3375 # with winepath so that path translation in the cross-to-mingw
3376 # case works properly.
3377 lt_replace_pathsep_nix_to_dos="s|:|;|g"
3378 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
3379 $SED -e "$lt_replace_pathsep_nix_to_dos"`
3380 fi
3381 # Now, add the leading and trailing path separators back
3382 case "$1" in
3383 :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
3384 ;;
3385 esac
3386 case "$1" in
3387 *: ) func_append func_to_host_pathlist_result ";"
3388 ;;
3389 esac
3390 ;;
3391 esac
3392 fi
3393 }
3394 # end: func_to_host_pathlist
33954126
33964127 # func_emit_cwrapperexe_src
33974128 # emit the source code for a wrapper executable on stdout
35624293 EOF
35634294
35644295 cat <<EOF
3565 const char * MAGIC_EXE = "$magic_exe";
4296 volatile const char * MAGIC_EXE = "$magic_exe";
35664297 const char * LIB_PATH_VARNAME = "$shlibpath_var";
35674298 EOF
35684299
35694300 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3570 func_to_host_pathlist "$temp_rpath"
4301 func_to_host_path "$temp_rpath"
35714302 cat <<EOF
3572 const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
4303 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
35734304 EOF
35744305 else
35754306 cat <<"EOF"
35784309 fi
35794310
35804311 if test -n "$dllsearchpath"; then
3581 func_to_host_pathlist "$dllsearchpath:"
4312 func_to_host_path "$dllsearchpath:"
35824313 cat <<EOF
35834314 const char * EXE_PATH_VARNAME = "PATH";
3584 const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
4315 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
35854316 EOF
35864317 else
35874318 cat <<"EOF"
37644495
37654496 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
37664497 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4498 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4499 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4500 because on Windows, both *_VARNAMEs are PATH but uninstalled
4501 libraries must come first. */
4502 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
37674503 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3768 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
37694504
37704505 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
37714506 nonnull (lt_argv_zero));
45145249 ;;
45155250 *)
45165251 if test "$prev" = dlfiles; then
4517 dlfiles="$dlfiles $arg"
5252 func_append dlfiles " $arg"
45185253 else
4519 dlprefiles="$dlprefiles $arg"
5254 func_append dlprefiles " $arg"
45205255 fi
45215256 prev=
45225257 continue
45405275 *-*-darwin*)
45415276 case "$deplibs " in
45425277 *" $qarg.ltframework "*) ;;
4543 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
5278 *) func_append deplibs " $qarg.ltframework" # this is fixed later
45445279 ;;
45455280 esac
45465281 ;;
45595294 moreargs=
45605295 for fil in `cat "$save_arg"`
45615296 do
4562 # moreargs="$moreargs $fil"
5297 # func_append moreargs " $fil"
45635298 arg=$fil
45645299 # A libtool-controlled object.
45655300
45885323
45895324 if test "$prev" = dlfiles; then
45905325 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4591 dlfiles="$dlfiles $pic_object"
5326 func_append dlfiles " $pic_object"
45925327 prev=
45935328 continue
45945329 else
46005335 # CHECK ME: I think I busted this. -Ossama
46015336 if test "$prev" = dlprefiles; then
46025337 # Preload the old-style object.
4603 dlprefiles="$dlprefiles $pic_object"
5338 func_append dlprefiles " $pic_object"
46045339 prev=
46055340 fi
46065341
46705405 if test "$prev" = rpath; then
46715406 case "$rpath " in
46725407 *" $arg "*) ;;
4673 *) rpath="$rpath $arg" ;;
5408 *) func_append rpath " $arg" ;;
46745409 esac
46755410 else
46765411 case "$xrpath " in
46775412 *" $arg "*) ;;
4678 *) xrpath="$xrpath $arg" ;;
5413 *) func_append xrpath " $arg" ;;
46795414 esac
46805415 fi
46815416 prev=
46875422 continue
46885423 ;;
46895424 weak)
4690 weak_libs="$weak_libs $arg"
5425 func_append weak_libs " $arg"
46915426 prev=
46925427 continue
46935428 ;;
46945429 xcclinker)
4695 linker_flags="$linker_flags $qarg"
4696 compiler_flags="$compiler_flags $qarg"
5430 func_append linker_flags " $qarg"
5431 func_append compiler_flags " $qarg"
46975432 prev=
46985433 func_append compile_command " $qarg"
46995434 func_append finalize_command " $qarg"
47005435 continue
47015436 ;;
47025437 xcompiler)
4703 compiler_flags="$compiler_flags $qarg"
5438 func_append compiler_flags " $qarg"
47045439 prev=
47055440 func_append compile_command " $qarg"
47065441 func_append finalize_command " $qarg"
47075442 continue
47085443 ;;
47095444 xlinker)
4710 linker_flags="$linker_flags $qarg"
4711 compiler_flags="$compiler_flags $wl$qarg"
5445 func_append linker_flags " $qarg"
5446 func_append compiler_flags " $wl$qarg"
47125447 prev=
47135448 func_append compile_command " $wl$qarg"
47145449 func_append finalize_command " $wl$qarg"
47995534 ;;
48005535
48015536 -L*)
4802 func_stripname '-L' '' "$arg"
4803 dir=$func_stripname_result
4804 if test -z "$dir"; then
5537 func_stripname "-L" '' "$arg"
5538 if test -z "$func_stripname_result"; then
48055539 if test "$#" -gt 0; then
48065540 func_fatal_error "require no space between \`-L' and \`$1'"
48075541 else
48085542 func_fatal_error "need path for \`-L' option"
48095543 fi
48105544 fi
5545 func_resolve_sysroot "$func_stripname_result"
5546 dir=$func_resolve_sysroot_result
48115547 # We need an absolute path.
48125548 case $dir in
48135549 [\\/]* | [A-Za-z]:[\\/]*) ;;
48195555 ;;
48205556 esac
48215557 case "$deplibs " in
4822 *" -L$dir "*) ;;
5558 *" -L$dir "* | *" $arg "*)
5559 # Will only happen for absolute or sysroot arguments
5560 ;;
48235561 *)
4824 deplibs="$deplibs -L$dir"
4825 lib_search_path="$lib_search_path $dir"
5562 # Preserve sysroot, but never include relative directories
5563 case $dir in
5564 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
5565 *) func_append deplibs " -L$dir" ;;
5566 esac
5567 func_append lib_search_path " $dir"
48265568 ;;
48275569 esac
48285570 case $host in
48315573 case :$dllsearchpath: in
48325574 *":$dir:"*) ;;
48335575 ::) dllsearchpath=$dir;;
4834 *) dllsearchpath="$dllsearchpath:$dir";;
5576 *) func_append dllsearchpath ":$dir";;
48355577 esac
48365578 case :$dllsearchpath: in
48375579 *":$testbindir:"*) ;;
48385580 ::) dllsearchpath=$testbindir;;
4839 *) dllsearchpath="$dllsearchpath:$testbindir";;
5581 *) func_append dllsearchpath ":$testbindir";;
48405582 esac
48415583 ;;
48425584 esac
48605602 ;;
48615603 *-*-rhapsody* | *-*-darwin1.[012])
48625604 # Rhapsody C and math libraries are in the System framework
4863 deplibs="$deplibs System.ltframework"
5605 func_append deplibs " System.ltframework"
48645606 continue
48655607 ;;
48665608 *-*-sco3.2v5* | *-*-sco5v6*)
48805622 ;;
48815623 esac
48825624 fi
4883 deplibs="$deplibs $arg"
5625 func_append deplibs " $arg"
48845626 continue
48855627 ;;
48865628
48925634 # Tru64 UNIX uses -model [arg] to determine the layout of C++
48935635 # classes, name mangling, and exception handling.
48945636 # Darwin uses the -arch flag to determine output architecture.
4895 -model|-arch|-isysroot)
4896 compiler_flags="$compiler_flags $arg"
5637 -model|-arch|-isysroot|--sysroot)
5638 func_append compiler_flags " $arg"
48975639 func_append compile_command " $arg"
48985640 func_append finalize_command " $arg"
48995641 prev=xcompiler
49015643 ;;
49025644
49035645 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4904 compiler_flags="$compiler_flags $arg"
5646 func_append compiler_flags " $arg"
49055647 func_append compile_command " $arg"
49065648 func_append finalize_command " $arg"
49075649 case "$new_inherited_linker_flags " in
49085650 *" $arg "*) ;;
4909 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
5651 * ) func_append new_inherited_linker_flags " $arg" ;;
49105652 esac
49115653 continue
49125654 ;;
49735715 # We need an absolute path.
49745716 case $dir in
49755717 [\\/]* | [A-Za-z]:[\\/]*) ;;
5718 =*)
5719 func_stripname '=' '' "$dir"
5720 dir=$lt_sysroot$func_stripname_result
5721 ;;
49765722 *)
49775723 func_fatal_error "only absolute run-paths are allowed"
49785724 ;;
49795725 esac
49805726 case "$xrpath " in
49815727 *" $dir "*) ;;
4982 *) xrpath="$xrpath $dir" ;;
5728 *) func_append xrpath " $dir" ;;
49835729 esac
49845730 continue
49855731 ;;
50325778 for flag in $args; do
50335779 IFS="$save_ifs"
50345780 func_quote_for_eval "$flag"
5035 arg="$arg $func_quote_for_eval_result"
5036 compiler_flags="$compiler_flags $func_quote_for_eval_result"
5781 func_append arg " $func_quote_for_eval_result"
5782 func_append compiler_flags " $func_quote_for_eval_result"
50375783 done
50385784 IFS="$save_ifs"
50395785 func_stripname ' ' '' "$arg"
50485794 for flag in $args; do
50495795 IFS="$save_ifs"
50505796 func_quote_for_eval "$flag"
5051 arg="$arg $wl$func_quote_for_eval_result"
5052 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
5053 linker_flags="$linker_flags $func_quote_for_eval_result"
5797 func_append arg " $wl$func_quote_for_eval_result"
5798 func_append compiler_flags " $wl$func_quote_for_eval_result"
5799 func_append linker_flags " $func_quote_for_eval_result"
50545800 done
50555801 IFS="$save_ifs"
50565802 func_stripname ' ' '' "$arg"
50895835 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
50905836 # @file GCC response files
50915837 # -tp=* Portland pgcc target processor selection
5838 # --sysroot=* for sysroot support
5839 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
50925840 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5093 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
5841 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
5842 -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
50945843 func_quote_for_eval "$arg"
50955844 arg="$func_quote_for_eval_result"
50965845 func_append compile_command " $arg"
50975846 func_append finalize_command " $arg"
5098 compiler_flags="$compiler_flags $arg"
5847 func_append compiler_flags " $arg"
50995848 continue
51005849 ;;
51015850
51075856
51085857 *.$objext)
51095858 # A standard object.
5110 objs="$objs $arg"
5859 func_append objs " $arg"
51115860 ;;
51125861
51135862 *.lo)
51385887
51395888 if test "$prev" = dlfiles; then
51405889 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5141 dlfiles="$dlfiles $pic_object"
5890 func_append dlfiles " $pic_object"
51425891 prev=
51435892 continue
51445893 else
51505899 # CHECK ME: I think I busted this. -Ossama
51515900 if test "$prev" = dlprefiles; then
51525901 # Preload the old-style object.
5153 dlprefiles="$dlprefiles $pic_object"
5902 func_append dlprefiles " $pic_object"
51545903 prev=
51555904 fi
51565905
51955944
51965945 *.$libext)
51975946 # An archive.
5198 deplibs="$deplibs $arg"
5199 old_deplibs="$old_deplibs $arg"
5947 func_append deplibs " $arg"
5948 func_append old_deplibs " $arg"
52005949 continue
52015950 ;;
52025951
52035952 *.la)
52045953 # A libtool-controlled library.
52055954
5955 func_resolve_sysroot "$arg"
52065956 if test "$prev" = dlfiles; then
52075957 # This library was specified with -dlopen.
5208 dlfiles="$dlfiles $arg"
5958 func_append dlfiles " $func_resolve_sysroot_result"
52095959 prev=
52105960 elif test "$prev" = dlprefiles; then
52115961 # The library was specified with -dlpreopen.
5212 dlprefiles="$dlprefiles $arg"
5962 func_append dlprefiles " $func_resolve_sysroot_result"
52135963 prev=
52145964 else
5215 deplibs="$deplibs $arg"
5965 func_append deplibs " $func_resolve_sysroot_result"
52165966 fi
52175967 continue
52185968 ;;
52596009
52606010 func_dirname "$output" "/" ""
52616011 output_objdir="$func_dirname_result$objdir"
6012 func_to_tool_file "$output_objdir/"
6013 tool_output_objdir=$func_to_tool_file_result
52626014 # Create the object directory.
52636015 func_mkdir_p "$output_objdir"
52646016
52796031 # Find all interdependent deplibs by searching for libraries
52806032 # that are linked more than once (e.g. -la -lb -la)
52816033 for deplib in $deplibs; do
5282 if $opt_duplicate_deps ; then
6034 if $opt_preserve_dup_deps ; then
52836035 case "$libs " in
5284 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6036 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
52856037 esac
52866038 fi
5287 libs="$libs $deplib"
6039 func_append libs " $deplib"
52886040 done
52896041
52906042 if test "$linkmode" = lib; then
52976049 if $opt_duplicate_compiler_generated_deps; then
52986050 for pre_post_dep in $predeps $postdeps; do
52996051 case "$pre_post_deps " in
5300 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
6052 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
53016053 esac
5302 pre_post_deps="$pre_post_deps $pre_post_dep"
6054 func_append pre_post_deps " $pre_post_dep"
53036055 done
53046056 fi
53056057 pre_post_deps=
53666118 for lib in $dlprefiles; do
53676119 # Ignore non-libtool-libs
53686120 dependency_libs=
6121 func_resolve_sysroot "$lib"
53696122 case $lib in
5370 *.la) func_source "$lib" ;;
6123 *.la) func_source "$func_resolve_sysroot_result" ;;
53716124 esac
53726125
53736126 # Collect preopened libtool deplibs, except any this library
53776130 deplib_base=$func_basename_result
53786131 case " $weak_libs " in
53796132 *" $deplib_base "*) ;;
5380 *) deplibs="$deplibs $deplib" ;;
6133 *) func_append deplibs " $deplib" ;;
53816134 esac
53826135 done
53836136 done
53986151 compile_deplibs="$deplib $compile_deplibs"
53996152 finalize_deplibs="$deplib $finalize_deplibs"
54006153 else
5401 compiler_flags="$compiler_flags $deplib"
6154 func_append compiler_flags " $deplib"
54026155 if test "$linkmode" = lib ; then
54036156 case "$new_inherited_linker_flags " in
54046157 *" $deplib "*) ;;
5405 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
6158 * ) func_append new_inherited_linker_flags " $deplib" ;;
54066159 esac
54076160 fi
54086161 fi
54876240 if test "$linkmode" = lib ; then
54886241 case "$new_inherited_linker_flags " in
54896242 *" $deplib "*) ;;
5490 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
6243 * ) func_append new_inherited_linker_flags " $deplib" ;;
54916244 esac
54926245 fi
54936246 fi
55006253 test "$pass" = conv && continue
55016254 newdependency_libs="$deplib $newdependency_libs"
55026255 func_stripname '-L' '' "$deplib"
5503 newlib_search_path="$newlib_search_path $func_stripname_result"
6256 func_resolve_sysroot "$func_stripname_result"
6257 func_append newlib_search_path " $func_resolve_sysroot_result"
55046258 ;;
55056259 prog)
55066260 if test "$pass" = conv; then
55146268 finalize_deplibs="$deplib $finalize_deplibs"
55156269 fi
55166270 func_stripname '-L' '' "$deplib"
5517 newlib_search_path="$newlib_search_path $func_stripname_result"
6271 func_resolve_sysroot "$func_stripname_result"
6272 func_append newlib_search_path " $func_resolve_sysroot_result"
55186273 ;;
55196274 *)
55206275 func_warning "\`-L' is ignored for archives/objects"
55256280 -R*)
55266281 if test "$pass" = link; then
55276282 func_stripname '-R' '' "$deplib"
5528 dir=$func_stripname_result
6283 func_resolve_sysroot "$func_stripname_result"
6284 dir=$func_resolve_sysroot_result
55296285 # Make sure the xrpath contains only unique directories.
55306286 case "$xrpath " in
55316287 *" $dir "*) ;;
5532 *) xrpath="$xrpath $dir" ;;
6288 *) func_append xrpath " $dir" ;;
55336289 esac
55346290 fi
55356291 deplibs="$deplib $deplibs"
55366292 continue
55376293 ;;
5538 *.la) lib="$deplib" ;;
6294 *.la)
6295 func_resolve_sysroot "$deplib"
6296 lib=$func_resolve_sysroot_result
6297 ;;
55396298 *.$libext)
55406299 if test "$pass" = conv; then
55416300 deplibs="$deplib $deplibs"
55986357 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
55996358 # If there is no dlopen support or we're linking statically,
56006359 # we need to preload.
5601 newdlprefiles="$newdlprefiles $deplib"
6360 func_append newdlprefiles " $deplib"
56026361 compile_deplibs="$deplib $compile_deplibs"
56036362 finalize_deplibs="$deplib $finalize_deplibs"
56046363 else
5605 newdlfiles="$newdlfiles $deplib"
6364 func_append newdlfiles " $deplib"
56066365 fi
56076366 fi
56086367 continue
56486407 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
56496408 case " $new_inherited_linker_flags " in
56506409 *" $tmp_inherited_linker_flag "*) ;;
5651 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
6410 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
56526411 esac
56536412 done
56546413 fi
56566415 if test "$linkmode,$pass" = "lib,link" ||
56576416 test "$linkmode,$pass" = "prog,scan" ||
56586417 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5659 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5660 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
6418 test -n "$dlopen" && func_append dlfiles " $dlopen"
6419 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
56616420 fi
56626421
56636422 if test "$pass" = conv; then
56686427 func_fatal_error "cannot find name of link library for \`$lib'"
56696428 fi
56706429 # It is a libtool convenience library, so add in its objects.
5671 convenience="$convenience $ladir/$objdir/$old_library"
5672 old_convenience="$old_convenience $ladir/$objdir/$old_library"
6430 func_append convenience " $ladir/$objdir/$old_library"
6431 func_append old_convenience " $ladir/$objdir/$old_library"
56736432 elif test "$linkmode" != prog && test "$linkmode" != lib; then
56746433 func_fatal_error "\`$lib' is not a convenience library"
56756434 fi
56766435 tmp_libs=
56776436 for deplib in $dependency_libs; do
56786437 deplibs="$deplib $deplibs"
5679 if $opt_duplicate_deps ; then
6438 if $opt_preserve_dup_deps ; then
56806439 case "$tmp_libs " in
5681 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6440 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
56826441 esac
56836442 fi
5684 tmp_libs="$tmp_libs $deplib"
6443 func_append tmp_libs " $deplib"
56856444 done
56866445 continue
56876446 fi # $pass = conv
56896448
56906449 # Get the name of the library we link against.
56916450 linklib=
5692 for l in $old_library $library_names; do
5693 linklib="$l"
5694 done
6451 if test -n "$old_library" &&
6452 { test "$prefer_static_libs" = yes ||
6453 test "$prefer_static_libs,$installed" = "built,no"; }; then
6454 linklib=$old_library
6455 else
6456 for l in $old_library $library_names; do
6457 linklib="$l"
6458 done
6459 fi
56956460 if test -z "$linklib"; then
56966461 func_fatal_error "cannot find name of link library for \`$lib'"
56976462 fi
57086473 # statically, we need to preload. We also need to preload any
57096474 # dependent libraries so libltdl's deplib preloader doesn't
57106475 # bomb out in the load deplibs phase.
5711 dlprefiles="$dlprefiles $lib $dependency_libs"
6476 func_append dlprefiles " $lib $dependency_libs"
57126477 else
5713 newdlfiles="$newdlfiles $lib"
6478 func_append newdlfiles " $lib"
57146479 fi
57156480 continue
57166481 fi # $pass = dlopen
57326497
57336498 # Find the relevant object directory and library name.
57346499 if test "X$installed" = Xyes; then
5735 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6500 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
57366501 func_warning "library \`$lib' was moved."
57376502 dir="$ladir"
57386503 absdir="$abs_ladir"
57396504 libdir="$abs_ladir"
57406505 else
5741 dir="$libdir"
5742 absdir="$libdir"
6506 dir="$lt_sysroot$libdir"
6507 absdir="$lt_sysroot$libdir"
57436508 fi
57446509 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
57456510 else
57476512 dir="$ladir"
57486513 absdir="$abs_ladir"
57496514 # Remove this search path later
5750 notinst_path="$notinst_path $abs_ladir"
6515 func_append notinst_path " $abs_ladir"
57516516 else
57526517 dir="$ladir/$objdir"
57536518 absdir="$abs_ladir/$objdir"
57546519 # Remove this search path later
5755 notinst_path="$notinst_path $abs_ladir"
6520 func_append notinst_path " $abs_ladir"
57566521 fi
57576522 fi # $installed = yes
57586523 func_stripname 'lib' '.la' "$laname"
57636528 if test -z "$libdir" && test "$linkmode" = prog; then
57646529 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
57656530 fi
5766 # Prefer using a static library (so that no silly _DYNAMIC symbols
5767 # are required to link).
5768 if test -n "$old_library"; then
5769 newdlprefiles="$newdlprefiles $dir/$old_library"
5770 # Keep a list of preopened convenience libraries to check
5771 # that they are being used correctly in the link pass.
5772 test -z "$libdir" && \
5773 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
5774 # Otherwise, use the dlname, so that lt_dlopen finds it.
5775 elif test -n "$dlname"; then
5776 newdlprefiles="$newdlprefiles $dir/$dlname"
5777 else
5778 newdlprefiles="$newdlprefiles $dir/$linklib"
5779 fi
6531 case "$host" in
6532 # special handling for platforms with PE-DLLs.
6533 *cygwin* | *mingw* | *cegcc* )
6534 # Linker will automatically link against shared library if both
6535 # static and shared are present. Therefore, ensure we extract
6536 # symbols from the import library if a shared library is present
6537 # (otherwise, the dlopen module name will be incorrect). We do
6538 # this by putting the import library name into $newdlprefiles.
6539 # We recover the dlopen module name by 'saving' the la file
6540 # name in a special purpose variable, and (later) extracting the
6541 # dlname from the la file.
6542 if test -n "$dlname"; then
6543 func_tr_sh "$dir/$linklib"
6544 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
6545 func_append newdlprefiles " $dir/$linklib"
6546 else
6547 func_append newdlprefiles " $dir/$old_library"
6548 # Keep a list of preopened convenience libraries to check
6549 # that they are being used correctly in the link pass.
6550 test -z "$libdir" && \
6551 func_append dlpreconveniencelibs " $dir/$old_library"
6552 fi
6553 ;;
6554 * )
6555 # Prefer using a static library (so that no silly _DYNAMIC symbols
6556 # are required to link).
6557 if test -n "$old_library"; then
6558 func_append newdlprefiles " $dir/$old_library"
6559 # Keep a list of preopened convenience libraries to check
6560 # that they are being used correctly in the link pass.
6561 test -z "$libdir" && \
6562 func_append dlpreconveniencelibs " $dir/$old_library"
6563 # Otherwise, use the dlname, so that lt_dlopen finds it.
6564 elif test -n "$dlname"; then
6565 func_append newdlprefiles " $dir/$dlname"
6566 else
6567 func_append newdlprefiles " $dir/$linklib"
6568 fi
6569 ;;
6570 esac
57806571 fi # $pass = dlpreopen
57816572
57826573 if test -z "$libdir"; then
57946585
57956586
57966587 if test "$linkmode" = prog && test "$pass" != link; then
5797 newlib_search_path="$newlib_search_path $ladir"
6588 func_append newlib_search_path " $ladir"
57986589 deplibs="$lib $deplibs"
57996590
58006591 linkalldeplibs=no
58076598 for deplib in $dependency_libs; do
58086599 case $deplib in
58096600 -L*) func_stripname '-L' '' "$deplib"
5810 newlib_search_path="$newlib_search_path $func_stripname_result"
6601 func_resolve_sysroot "$func_stripname_result"
6602 func_append newlib_search_path " $func_resolve_sysroot_result"
58116603 ;;
58126604 esac
58136605 # Need to link against all dependency_libs?
58186610 # or/and link against static libraries
58196611 newdependency_libs="$deplib $newdependency_libs"
58206612 fi
5821 if $opt_duplicate_deps ; then
6613 if $opt_preserve_dup_deps ; then
58226614 case "$tmp_libs " in
5823 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6615 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
58246616 esac
58256617 fi
5826 tmp_libs="$tmp_libs $deplib"
6618 func_append tmp_libs " $deplib"
58276619 done # for deplib
58286620 continue
58296621 fi # $linkmode = prog...
58386630 # Make sure the rpath contains only unique directories.
58396631 case "$temp_rpath:" in
58406632 *"$absdir:"*) ;;
5841 *) temp_rpath="$temp_rpath$absdir:" ;;
6633 *) func_append temp_rpath "$absdir:" ;;
58426634 esac
58436635 fi
58446636
58506642 *)
58516643 case "$compile_rpath " in
58526644 *" $absdir "*) ;;
5853 *) compile_rpath="$compile_rpath $absdir"
6645 *) func_append compile_rpath " $absdir" ;;
58546646 esac
58556647 ;;
58566648 esac
58596651 *)
58606652 case "$finalize_rpath " in
58616653 *" $libdir "*) ;;
5862 *) finalize_rpath="$finalize_rpath $libdir"
6654 *) func_append finalize_rpath " $libdir" ;;
58636655 esac
58646656 ;;
58656657 esac
58846676 case $host in
58856677 *cygwin* | *mingw* | *cegcc*)
58866678 # No point in relinking DLLs because paths are not encoded
5887 notinst_deplibs="$notinst_deplibs $lib"
6679 func_append notinst_deplibs " $lib"
58886680 need_relink=no
58896681 ;;
58906682 *)
58916683 if test "$installed" = no; then
5892 notinst_deplibs="$notinst_deplibs $lib"
6684 func_append notinst_deplibs " $lib"
58936685 need_relink=yes
58946686 fi
58956687 ;;
59246716 *)
59256717 case "$compile_rpath " in
59266718 *" $absdir "*) ;;
5927 *) compile_rpath="$compile_rpath $absdir"
6719 *) func_append compile_rpath " $absdir" ;;
59286720 esac
59296721 ;;
59306722 esac
59336725 *)
59346726 case "$finalize_rpath " in
59356727 *" $libdir "*) ;;
5936 *) finalize_rpath="$finalize_rpath $libdir"
6728 *) func_append finalize_rpath " $libdir" ;;
59376729 esac
59386730 ;;
59396731 esac
59876779 linklib=$newlib
59886780 fi # test -n "$old_archive_from_expsyms_cmds"
59896781
5990 if test "$linkmode" = prog || test "$mode" != relink; then
6782 if test "$linkmode" = prog || test "$opt_mode" != relink; then
59916783 add_shlibpath=
59926784 add_dir=
59936785 add=
60436835 if test -n "$inst_prefix_dir"; then
60446836 case $libdir in
60456837 [\\/]*)
6046 add_dir="$add_dir -L$inst_prefix_dir$libdir"
6838 func_append add_dir " -L$inst_prefix_dir$libdir"
60476839 ;;
60486840 esac
60496841 fi
60656857 if test -n "$add_shlibpath"; then
60666858 case :$compile_shlibpath: in
60676859 *":$add_shlibpath:"*) ;;
6068 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
6860 *) func_append compile_shlibpath "$add_shlibpath:" ;;
60696861 esac
60706862 fi
60716863 if test "$linkmode" = prog; then
60796871 test "$hardcode_shlibpath_var" = yes; then
60806872 case :$finalize_shlibpath: in
60816873 *":$libdir:"*) ;;
6082 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6874 *) func_append finalize_shlibpath "$libdir:" ;;
60836875 esac
60846876 fi
60856877 fi
60866878 fi
60876879
6088 if test "$linkmode" = prog || test "$mode" = relink; then
6880 if test "$linkmode" = prog || test "$opt_mode" = relink; then
60896881 add_shlibpath=
60906882 add_dir=
60916883 add=
60996891 elif test "$hardcode_shlibpath_var" = yes; then
61006892 case :$finalize_shlibpath: in
61016893 *":$libdir:"*) ;;
6102 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6894 *) func_append finalize_shlibpath "$libdir:" ;;
61036895 esac
61046896 add="-l$name"
61056897 elif test "$hardcode_automatic" = yes; then
61166908 if test -n "$inst_prefix_dir"; then
61176909 case $libdir in
61186910 [\\/]*)
6119 add_dir="$add_dir -L$inst_prefix_dir$libdir"
6911 func_append add_dir " -L$inst_prefix_dir$libdir"
61206912 ;;
61216913 esac
61226914 fi
61936985 temp_xrpath=$func_stripname_result
61946986 case " $xrpath " in
61956987 *" $temp_xrpath "*) ;;
6196 *) xrpath="$xrpath $temp_xrpath";;
6988 *) func_append xrpath " $temp_xrpath";;
61976989 esac;;
6198 *) temp_deplibs="$temp_deplibs $libdir";;
6990 *) func_append temp_deplibs " $libdir";;
61996991 esac
62006992 done
62016993 dependency_libs="$temp_deplibs"
62026994 fi
62036995
6204 newlib_search_path="$newlib_search_path $absdir"
6996 func_append newlib_search_path " $absdir"
62056997 # Link against this library
62066998 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
62076999 # ... and its dependency_libs
62087000 tmp_libs=
62097001 for deplib in $dependency_libs; do
62107002 newdependency_libs="$deplib $newdependency_libs"
6211 if $opt_duplicate_deps ; then
7003 case $deplib in
7004 -L*) func_stripname '-L' '' "$deplib"
7005 func_resolve_sysroot "$func_stripname_result";;
7006 *) func_resolve_sysroot "$deplib" ;;
7007 esac
7008 if $opt_preserve_dup_deps ; then
62127009 case "$tmp_libs " in
6213 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
7010 *" $func_resolve_sysroot_result "*)
7011 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
62147012 esac
62157013 fi
6216 tmp_libs="$tmp_libs $deplib"
7014 func_append tmp_libs " $func_resolve_sysroot_result"
62177015 done
62187016
62197017 if test "$link_all_deplibs" != no; then
62237021 case $deplib in
62247022 -L*) path="$deplib" ;;
62257023 *.la)
7024 func_resolve_sysroot "$deplib"
7025 deplib=$func_resolve_sysroot_result
62267026 func_dirname "$deplib" "" "."
6227 dir="$func_dirname_result"
7027 dir=$func_dirname_result
62287028 # We need an absolute path.
62297029 case $dir in
62307030 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
62517051 if test -z "$darwin_install_name"; then
62527052 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
62537053 fi
6254 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
6255 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
7054 func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7055 func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
62567056 path=
62577057 fi
62587058 fi
63027102 for dir in $newlib_search_path; do
63037103 case "$lib_search_path " in
63047104 *" $dir "*) ;;
6305 *) lib_search_path="$lib_search_path $dir" ;;
7105 *) func_append lib_search_path " $dir" ;;
63067106 esac
63077107 done
63087108 newlib_search_path=
63607160 -L*)
63617161 case " $tmp_libs " in
63627162 *" $deplib "*) ;;
6363 *) tmp_libs="$tmp_libs $deplib" ;;
7163 *) func_append tmp_libs " $deplib" ;;
63647164 esac
63657165 ;;
6366 *) tmp_libs="$tmp_libs $deplib" ;;
7166 *) func_append tmp_libs " $deplib" ;;
63677167 esac
63687168 done
63697169 eval $var=\"$tmp_libs\"
63797179 ;;
63807180 esac
63817181 if test -n "$i" ; then
6382 tmp_libs="$tmp_libs $i"
7182 func_append tmp_libs " $i"
63837183 fi
63847184 done
63857185 dependency_libs=$tmp_libs
64207220 # Now set the variables for building old libraries.
64217221 build_libtool_libs=no
64227222 oldlibs="$output"
6423 objs="$objs$old_deplibs"
7223 func_append objs "$old_deplibs"
64247224 ;;
64257225
64267226 lib)
64567256 echo
64577257 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
64587258 $ECHO "*** objects $objs is not portable!"
6459 libobjs="$libobjs $objs"
7259 func_append libobjs " $objs"
64607260 fi
64617261 fi
64627262
66547454 done
66557455
66567456 # Make executables depend on our current version.
6657 verstring="$verstring:${current}.0"
7457 func_append verstring ":${current}.0"
66587458 ;;
66597459
66607460 qnx)
67227522 fi
67237523
67247524 func_generate_dlsyms "$libname" "$libname" "yes"
6725 libobjs="$libobjs $symfileobj"
7525 func_append libobjs " $symfileobj"
67267526 test "X$libobjs" = "X " && libobjs=
67277527
6728 if test "$mode" != relink; then
7528 if test "$opt_mode" != relink; then
67297529 # Remove our outputs, but don't remove object files since they
67307530 # may have been created when compiling PIC objects.
67317531 removelist=
67417541 continue
67427542 fi
67437543 fi
6744 removelist="$removelist $p"
7544 func_append removelist " $p"
67457545 ;;
67467546 *) ;;
67477547 esac
67527552
67537553 # Now set the variables for building old libraries.
67547554 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6755 oldlibs="$oldlibs $output_objdir/$libname.$libext"
7555 func_append oldlibs " $output_objdir/$libname.$libext"
67567556
67577557 # Transform .lo files to .o files.
67587558 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
67697569 # If the user specified any rpath flags, then add them.
67707570 temp_xrpath=
67717571 for libdir in $xrpath; do
6772 temp_xrpath="$temp_xrpath -R$libdir"
7572 func_replace_sysroot "$libdir"
7573 func_append temp_xrpath " -R$func_replace_sysroot_result"
67737574 case "$finalize_rpath " in
67747575 *" $libdir "*) ;;
6775 *) finalize_rpath="$finalize_rpath $libdir" ;;
7576 *) func_append finalize_rpath " $libdir" ;;
67767577 esac
67777578 done
67787579 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
67867587 for lib in $old_dlfiles; do
67877588 case " $dlprefiles $dlfiles " in
67887589 *" $lib "*) ;;
6789 *) dlfiles="$dlfiles $lib" ;;
7590 *) func_append dlfiles " $lib" ;;
67907591 esac
67917592 done
67927593
67967597 for lib in $old_dlprefiles; do
67977598 case "$dlprefiles " in
67987599 *" $lib "*) ;;
6799 *) dlprefiles="$dlprefiles $lib" ;;
7600 *) func_append dlprefiles " $lib" ;;
68007601 esac
68017602 done
68027603
68087609 ;;
68097610 *-*-rhapsody* | *-*-darwin1.[012])
68107611 # Rhapsody C library is in the System framework
6811 deplibs="$deplibs System.ltframework"
7612 func_append deplibs " System.ltframework"
68127613 ;;
68137614 *-*-netbsd*)
68147615 # Don't link with libc until the a.out ld.so is fixed.
68257626 *)
68267627 # Add libc to deplibs on all other systems if necessary.
68277628 if test "$build_libtool_need_lc" = "yes"; then
6828 deplibs="$deplibs -lc"
7629 func_append deplibs " -lc"
68297630 fi
68307631 ;;
68317632 esac
68747675 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
68757676 case " $predeps $postdeps " in
68767677 *" $i "*)
6877 newdeplibs="$newdeplibs $i"
7678 func_append newdeplibs " $i"
68787679 i=""
68797680 ;;
68807681 esac
68857686 set dummy $deplib_matches; shift
68867687 deplib_match=$1
68877688 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6888 newdeplibs="$newdeplibs $i"
7689 func_append newdeplibs " $i"
68897690 else
68907691 droppeddeps=yes
68917692 echo
68997700 fi
69007701 ;;
69017702 *)
6902 newdeplibs="$newdeplibs $i"
7703 func_append newdeplibs " $i"
69037704 ;;
69047705 esac
69057706 done
69177718 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
69187719 case " $predeps $postdeps " in
69197720 *" $i "*)
6920 newdeplibs="$newdeplibs $i"
7721 func_append newdeplibs " $i"
69217722 i=""
69227723 ;;
69237724 esac
69287729 set dummy $deplib_matches; shift
69297730 deplib_match=$1
69307731 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6931 newdeplibs="$newdeplibs $i"
7732 func_append newdeplibs " $i"
69327733 else
69337734 droppeddeps=yes
69347735 echo
69507751 fi
69517752 ;;
69527753 *)
6953 newdeplibs="$newdeplibs $i"
7754 func_append newdeplibs " $i"
69547755 ;;
69557756 esac
69567757 done
69677768 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
69687769 case " $predeps $postdeps " in
69697770 *" $a_deplib "*)
6970 newdeplibs="$newdeplibs $a_deplib"
7771 func_append newdeplibs " $a_deplib"
69717772 a_deplib=""
69727773 ;;
69737774 esac
69747775 fi
69757776 if test -n "$a_deplib" ; then
69767777 libname=`eval "\\$ECHO \"$libname_spec\""`
7778 if test -n "$file_magic_glob"; then
7779 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
7780 else
7781 libnameglob=$libname
7782 fi
7783 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
69777784 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6978 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7785 if test "$want_nocaseglob" = yes; then
7786 shopt -s nocaseglob
7787 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7788 $nocaseglob
7789 else
7790 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7791 fi
69797792 for potent_lib in $potential_libs; do
69807793 # Follow soft links.
69817794 if ls -lLd "$potent_lib" 2>/dev/null |
69987811 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
69997812 $SED -e 10q |
70007813 $EGREP "$file_magic_regex" > /dev/null; then
7001 newdeplibs="$newdeplibs $a_deplib"
7814 func_append newdeplibs " $a_deplib"
70027815 a_deplib=""
70037816 break 2
70047817 fi
70237836 ;;
70247837 *)
70257838 # Add a -L argument.
7026 newdeplibs="$newdeplibs $a_deplib"
7839 func_append newdeplibs " $a_deplib"
70277840 ;;
70287841 esac
70297842 done # Gone through all deplibs.
70397852 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
70407853 case " $predeps $postdeps " in
70417854 *" $a_deplib "*)
7042 newdeplibs="$newdeplibs $a_deplib"
7855 func_append newdeplibs " $a_deplib"
70437856 a_deplib=""
70447857 ;;
70457858 esac
70527865 potlib="$potent_lib" # see symlink-check above in file_magic test
70537866 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
70547867 $EGREP "$match_pattern_regex" > /dev/null; then
7055 newdeplibs="$newdeplibs $a_deplib"
7868 func_append newdeplibs " $a_deplib"
70567869 a_deplib=""
70577870 break 2
70587871 fi
70777890 ;;
70787891 *)
70797892 # Add a -L argument.
7080 newdeplibs="$newdeplibs $a_deplib"
7893 func_append newdeplibs " $a_deplib"
70817894 ;;
70827895 esac
70837896 done # Gone through all deplibs.
71817994 *)
71827995 case " $deplibs " in
71837996 *" -L$path/$objdir "*)
7184 new_libs="$new_libs -L$path/$objdir" ;;
7997 func_append new_libs " -L$path/$objdir" ;;
71857998 esac
71867999 ;;
71878000 esac
71918004 -L*)
71928005 case " $new_libs " in
71938006 *" $deplib "*) ;;
7194 *) new_libs="$new_libs $deplib" ;;
8007 *) func_append new_libs " $deplib" ;;
71958008 esac
71968009 ;;
7197 *) new_libs="$new_libs $deplib" ;;
8010 *) func_append new_libs " $deplib" ;;
71988011 esac
71998012 done
72008013 deplibs="$new_libs"
72118024 hardcode_libdirs=
72128025 dep_rpath=
72138026 rpath="$finalize_rpath"
7214 test "$mode" != relink && rpath="$compile_rpath$rpath"
8027 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
72158028 for libdir in $rpath; do
72168029 if test -n "$hardcode_libdir_flag_spec"; then
72178030 if test -n "$hardcode_libdir_separator"; then
8031 func_replace_sysroot "$libdir"
8032 libdir=$func_replace_sysroot_result
72188033 if test -z "$hardcode_libdirs"; then
72198034 hardcode_libdirs="$libdir"
72208035 else
72238038 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
72248039 ;;
72258040 *)
7226 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8041 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
72278042 ;;
72288043 esac
72298044 fi
72308045 else
72318046 eval flag=\"$hardcode_libdir_flag_spec\"
7232 dep_rpath="$dep_rpath $flag"
8047 func_append dep_rpath " $flag"
72338048 fi
72348049 elif test -n "$runpath_var"; then
72358050 case "$perm_rpath " in
72368051 *" $libdir "*) ;;
7237 *) perm_rpath="$perm_rpath $libdir" ;;
8052 *) func_apped perm_rpath " $libdir" ;;
72388053 esac
72398054 fi
72408055 done
72528067 # We should set the runpath_var.
72538068 rpath=
72548069 for dir in $perm_rpath; do
7255 rpath="$rpath$dir:"
8070 func_append rpath "$dir:"
72568071 done
72578072 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
72588073 fi
72608075 fi
72618076
72628077 shlibpath="$finalize_shlibpath"
7263 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8078 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
72648079 if test -n "$shlibpath"; then
72658080 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
72668081 fi
72868101 linknames=
72878102 for link
72888103 do
7289 linknames="$linknames $link"
8104 func_append linknames " $link"
72908105 done
72918106
72928107 # Use standard objects if they are pic
72978112 if test -n "$export_symbols" && test -n "$include_expsyms"; then
72988113 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
72998114 export_symbols="$output_objdir/$libname.uexp"
7300 delfiles="$delfiles $export_symbols"
8115 func_append delfiles " $export_symbols"
73018116 fi
73028117
73038118 orig_export_symbols=
73288143 $opt_dry_run || $RM $export_symbols
73298144 cmds=$export_symbols_cmds
73308145 save_ifs="$IFS"; IFS='~'
7331 for cmd in $cmds; do
8146 for cmd1 in $cmds; do
73328147 IFS="$save_ifs"
7333 eval cmd=\"$cmd\"
7334 func_len " $cmd"
7335 len=$func_len_result
7336 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8148 # Take the normal branch if the nm_file_list_spec branch
8149 # doesn't work or if tool conversion is not needed.
8150 case $nm_file_list_spec~$to_tool_file_cmd in
8151 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8152 try_normal_branch=yes
8153 eval cmd=\"$cmd1\"
8154 func_len " $cmd"
8155 len=$func_len_result
8156 ;;
8157 *)
8158 try_normal_branch=no
8159 ;;
8160 esac
8161 if test "$try_normal_branch" = yes \
8162 && { test "$len" -lt "$max_cmd_len" \
8163 || test "$max_cmd_len" -le -1; }
8164 then
73378165 func_show_eval "$cmd" 'exit $?'
8166 skipped_export=false
8167 elif test -n "$nm_file_list_spec"; then
8168 func_basename "$output"
8169 output_la=$func_basename_result
8170 save_libobjs=$libobjs
8171 save_output=$output
8172 output=${output_objdir}/${output_la}.nm
8173 func_to_tool_file "$output"
8174 libobjs=$nm_file_list_spec$func_to_tool_file_result
8175 func_append delfiles " $output"
8176 func_verbose "creating $NM input file list: $output"
8177 for obj in $save_libobjs; do
8178 func_to_tool_file "$obj"
8179 $ECHO "$func_to_tool_file_result"
8180 done > "$output"
8181 eval cmd=\"$cmd1\"
8182 func_show_eval "$cmd" 'exit $?'
8183 output=$save_output
8184 libobjs=$save_libobjs
73388185 skipped_export=false
73398186 else
73408187 # The command line is too long to execute in one step.
73688215 # global variables. join(1) would be nice here, but unfortunately
73698216 # isn't a blessed tool.
73708217 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7371 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
8218 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
73728219 export_symbols=$output_objdir/$libname.def
73738220 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
73748221 fi
73788225 case " $convenience " in
73798226 *" $test_deplib "*) ;;
73808227 *)
7381 tmp_deplibs="$tmp_deplibs $test_deplib"
8228 func_append tmp_deplibs " $test_deplib"
73828229 ;;
73838230 esac
73848231 done
73988245 test "X$libobjs" = "X " && libobjs=
73998246 else
74008247 gentop="$output_objdir/${outputname}x"
7401 generated="$generated $gentop"
8248 func_append generated " $gentop"
74028249
74038250 func_extract_archives $gentop $convenience
7404 libobjs="$libobjs $func_extract_archives_result"
8251 func_append libobjs " $func_extract_archives_result"
74058252 test "X$libobjs" = "X " && libobjs=
74068253 fi
74078254 fi
74088255
74098256 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
74108257 eval flag=\"$thread_safe_flag_spec\"
7411 linker_flags="$linker_flags $flag"
8258 func_append linker_flags " $flag"
74128259 fi
74138260
74148261 # Make a backup of the uninstalled library when relinking
7415 if test "$mode" = relink; then
8262 if test "$opt_mode" = relink; then
74168263 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
74178264 fi
74188265
74748321 echo 'INPUT (' > $output
74758322 for obj in $save_libobjs
74768323 do
7477 $ECHO "$obj" >> $output
8324 func_to_tool_file "$obj"
8325 $ECHO "$func_to_tool_file_result" >> $output
74788326 done
74798327 echo ')' >> $output
7480 delfiles="$delfiles $output"
8328 func_append delfiles " $output"
8329 func_to_tool_file "$output"
8330 output=$func_to_tool_file_result
74818331 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
74828332 output=${output_objdir}/${output_la}.lnk
74838333 func_verbose "creating linker input file list: $output"
74918341 fi
74928342 for obj
74938343 do
7494 $ECHO "$obj" >> $output
8344 func_to_tool_file "$obj"
8345 $ECHO "$func_to_tool_file_result" >> $output
74958346 done
7496 delfiles="$delfiles $output"
7497 output=$firstobj\"$file_list_spec$output\"
8347 func_append delfiles " $output"
8348 func_to_tool_file "$output"
8349 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
74988350 else
74998351 if test -n "$save_libobjs"; then
75008352 func_verbose "creating reloadable object files..."
75458397 if test -n "$last_robj"; then
75468398 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
75478399 fi
7548 delfiles="$delfiles $output"
8400 func_append delfiles " $output"
75498401
75508402 else
75518403 output=
75798431 lt_exit=$?
75808432
75818433 # Restore the uninstalled library and exit
7582 if test "$mode" = relink; then
8434 if test "$opt_mode" = relink; then
75838435 ( cd "$output_objdir" && \
75848436 $RM "${realname}T" && \
75858437 $MV "${realname}U" "$realname" )
76128464 # global variables. join(1) would be nice here, but unfortunately
76138465 # isn't a blessed tool.
76148466 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7615 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
8467 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
76168468 export_symbols=$output_objdir/$libname.def
76178469 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
76188470 fi
76538505 # Add any objects from preloaded convenience libraries
76548506 if test -n "$dlprefiles"; then
76558507 gentop="$output_objdir/${outputname}x"
7656 generated="$generated $gentop"
8508 func_append generated " $gentop"
76578509
76588510 func_extract_archives $gentop $dlprefiles
7659 libobjs="$libobjs $func_extract_archives_result"
8511 func_append libobjs " $func_extract_archives_result"
76608512 test "X$libobjs" = "X " && libobjs=
76618513 fi
76628514
76728524 lt_exit=$?
76738525
76748526 # Restore the uninstalled library and exit
7675 if test "$mode" = relink; then
8527 if test "$opt_mode" = relink; then
76768528 ( cd "$output_objdir" && \
76778529 $RM "${realname}T" && \
76788530 $MV "${realname}U" "$realname" )
76848536 IFS="$save_ifs"
76858537
76868538 # Restore the uninstalled library and exit
7687 if test "$mode" = relink; then
8539 if test "$opt_mode" = relink; then
76888540 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
76898541
76908542 if test -n "$convenience"; then
77688620 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
77698621 else
77708622 gentop="$output_objdir/${obj}x"
7771 generated="$generated $gentop"
8623 func_append generated " $gentop"
77728624
77738625 func_extract_archives $gentop $convenience
77748626 reload_conv_objs="$reload_objs $func_extract_archives_result"
77758627 fi
77768628 fi
8629
8630 # If we're not building shared, we need to use non_pic_objs
8631 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
77778632
77788633 # Create the old-style object.
77798634 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
78488703 if test "$tagname" = CXX ; then
78498704 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
78508705 10.[0123])
7851 compile_command="$compile_command ${wl}-bind_at_load"
7852 finalize_command="$finalize_command ${wl}-bind_at_load"
8706 func_append compile_command " ${wl}-bind_at_load"
8707 func_append finalize_command " ${wl}-bind_at_load"
78538708 ;;
78548709 esac
78558710 fi
78698724 *)
78708725 case " $compile_deplibs " in
78718726 *" -L$path/$objdir "*)
7872 new_libs="$new_libs -L$path/$objdir" ;;
8727 func_append new_libs " -L$path/$objdir" ;;
78738728 esac
78748729 ;;
78758730 esac
78798734 -L*)
78808735 case " $new_libs " in
78818736 *" $deplib "*) ;;
7882 *) new_libs="$new_libs $deplib" ;;
8737 *) func_append new_libs " $deplib" ;;
78838738 esac
78848739 ;;
7885 *) new_libs="$new_libs $deplib" ;;
8740 *) func_append new_libs " $deplib" ;;
78868741 esac
78878742 done
78888743 compile_deplibs="$new_libs"
78898744
78908745
7891 compile_command="$compile_command $compile_deplibs"
7892 finalize_command="$finalize_command $finalize_deplibs"
8746 func_append compile_command " $compile_deplibs"
8747 func_append finalize_command " $finalize_deplibs"
78938748
78948749 if test -n "$rpath$xrpath"; then
78958750 # If the user specified any rpath flags, then add them.
78978752 # This is the magic to use -rpath.
78988753 case "$finalize_rpath " in
78998754 *" $libdir "*) ;;
7900 *) finalize_rpath="$finalize_rpath $libdir" ;;
8755 *) func_append finalize_rpath " $libdir" ;;
79018756 esac
79028757 done
79038758 fi
79168771 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
79178772 ;;
79188773 *)
7919 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8774 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
79208775 ;;
79218776 esac
79228777 fi
79238778 else
79248779 eval flag=\"$hardcode_libdir_flag_spec\"
7925 rpath="$rpath $flag"
8780 func_append rpath " $flag"
79268781 fi
79278782 elif test -n "$runpath_var"; then
79288783 case "$perm_rpath " in
79298784 *" $libdir "*) ;;
7930 *) perm_rpath="$perm_rpath $libdir" ;;
8785 *) func_append perm_rpath " $libdir" ;;
79318786 esac
79328787 fi
79338788 case $host in
79368791 case :$dllsearchpath: in
79378792 *":$libdir:"*) ;;
79388793 ::) dllsearchpath=$libdir;;
7939 *) dllsearchpath="$dllsearchpath:$libdir";;
8794 *) func_append dllsearchpath ":$libdir";;
79408795 esac
79418796 case :$dllsearchpath: in
79428797 *":$testbindir:"*) ;;
79438798 ::) dllsearchpath=$testbindir;;
7944 *) dllsearchpath="$dllsearchpath:$testbindir";;
8799 *) func_append dllsearchpath ":$testbindir";;
79458800 esac
79468801 ;;
79478802 esac
79678822 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
79688823 ;;
79698824 *)
7970 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8825 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
79718826 ;;
79728827 esac
79738828 fi
79748829 else
79758830 eval flag=\"$hardcode_libdir_flag_spec\"
7976 rpath="$rpath $flag"
8831 func_append rpath " $flag"
79778832 fi
79788833 elif test -n "$runpath_var"; then
79798834 case "$finalize_perm_rpath " in
79808835 *" $libdir "*) ;;
7981 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
8836 *) func_append finalize_perm_rpath " $libdir" ;;
79828837 esac
79838838 fi
79848839 done
80298884 exit_status=0
80308885 func_show_eval "$link_command" 'exit_status=$?'
80318886
8887 if test -n "$postlink_cmds"; then
8888 func_to_tool_file "$output"
8889 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8890 func_execute_cmds "$postlink_cmds" 'exit $?'
8891 fi
8892
80328893 # Delete the generated files.
80338894 if test -f "$output_objdir/${outputname}S.${objext}"; then
80348895 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
80518912 # We should set the runpath_var.
80528913 rpath=
80538914 for dir in $perm_rpath; do
8054 rpath="$rpath$dir:"
8915 func_append rpath "$dir:"
80558916 done
80568917 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
80578918 fi
80598920 # We should set the runpath_var.
80608921 rpath=
80618922 for dir in $finalize_perm_rpath; do
8062 rpath="$rpath$dir:"
8923 func_append rpath "$dir:"
80638924 done
80648925 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
80658926 fi
80748935 $opt_dry_run || $RM $output
80758936 # Link the executable and exit
80768937 func_show_eval "$link_command" 'exit $?'
8938
8939 if test -n "$postlink_cmds"; then
8940 func_to_tool_file "$output"
8941 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8942 func_execute_cmds "$postlink_cmds" 'exit $?'
8943 fi
8944
80778945 exit $EXIT_SUCCESS
80788946 fi
80798947
81068974 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
81078975
81088976 func_show_eval "$link_command" 'exit $?'
8977
8978 if test -n "$postlink_cmds"; then
8979 func_to_tool_file "$output_objdir/$outputname"
8980 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'`
8981 func_execute_cmds "$postlink_cmds" 'exit $?'
8982 fi
81098983
81108984 # Now create the wrapper script.
81118985 func_verbose "creating $output"
82049078 else
82059079 oldobjs="$old_deplibs $non_pic_objects"
82069080 if test "$preload" = yes && test -f "$symfileobj"; then
8207 oldobjs="$oldobjs $symfileobj"
9081 func_append oldobjs " $symfileobj"
82089082 fi
82099083 fi
82109084 addlibs="$old_convenience"
82129086
82139087 if test -n "$addlibs"; then
82149088 gentop="$output_objdir/${outputname}x"
8215 generated="$generated $gentop"
9089 func_append generated " $gentop"
82169090
82179091 func_extract_archives $gentop $addlibs
8218 oldobjs="$oldobjs $func_extract_archives_result"
9092 func_append oldobjs " $func_extract_archives_result"
82199093 fi
82209094
82219095 # Do each command in the archive commands.
82269100 # Add any objects from preloaded convenience libraries
82279101 if test -n "$dlprefiles"; then
82289102 gentop="$output_objdir/${outputname}x"
8229 generated="$generated $gentop"
9103 func_append generated " $gentop"
82309104
82319105 func_extract_archives $gentop $dlprefiles
8232 oldobjs="$oldobjs $func_extract_archives_result"
9106 func_append oldobjs " $func_extract_archives_result"
82339107 fi
82349108
82359109 # POSIX demands no paths to be encoded in archives. We have
82479121 else
82489122 echo "copying selected object files to avoid basename conflicts..."
82499123 gentop="$output_objdir/${outputname}x"
8250 generated="$generated $gentop"
9124 func_append generated " $gentop"
82519125 func_mkdir_p "$gentop"
82529126 save_oldobjs=$oldobjs
82539127 oldobjs=
82719145 esac
82729146 done
82739147 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
8274 oldobjs="$oldobjs $gentop/$newobj"
9148 func_append oldobjs " $gentop/$newobj"
82759149 ;;
8276 *) oldobjs="$oldobjs $obj" ;;
9150 *) func_append oldobjs " $obj" ;;
82779151 esac
82789152 done
82799153 fi
82829156 func_len " $cmds"
82839157 len=$func_len_result
82849158 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9159 cmds=$old_archive_cmds
9160 elif test -n "$archiver_list_spec"; then
9161 func_verbose "using command file archive linking..."
9162 for obj in $oldobjs
9163 do
9164 func_to_tool_file "$obj"
9165 $ECHO "$func_to_tool_file_result"
9166 done > $output_objdir/$libname.libcmd
9167 func_to_tool_file "$output_objdir/$libname.libcmd"
9168 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
82859169 cmds=$old_archive_cmds
82869170 else
82879171 # the command line is too long to link in one step, link in parts
83799263 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
83809264 test -z "$libdir" && \
83819265 func_fatal_error "\`$deplib' is not a valid libtool archive"
8382 newdependency_libs="$newdependency_libs $libdir/$name"
9266 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
83839267 ;;
8384 *) newdependency_libs="$newdependency_libs $deplib" ;;
9268 -L*)
9269 func_stripname -L '' "$deplib"
9270 func_replace_sysroot "$func_stripname_result"
9271 func_append newdependency_libs " -L$func_replace_sysroot_result"
9272 ;;
9273 -R*)
9274 func_stripname -R '' "$deplib"
9275 func_replace_sysroot "$func_stripname_result"
9276 func_append newdependency_libs " -R$func_replace_sysroot_result"
9277 ;;
9278 *) func_append newdependency_libs " $deplib" ;;
83859279 esac
83869280 done
83879281 dependency_libs="$newdependency_libs"
83959289 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
83969290 test -z "$libdir" && \
83979291 func_fatal_error "\`$lib' is not a valid libtool archive"
8398 newdlfiles="$newdlfiles $libdir/$name"
9292 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
83999293 ;;
8400 *) newdlfiles="$newdlfiles $lib" ;;
9294 *) func_append newdlfiles " $lib" ;;
84019295 esac
84029296 done
84039297 dlfiles="$newdlfiles"
84149308 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
84159309 test -z "$libdir" && \
84169310 func_fatal_error "\`$lib' is not a valid libtool archive"
8417 newdlprefiles="$newdlprefiles $libdir/$name"
9311 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
84189312 ;;
84199313 esac
84209314 done
84269320 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
84279321 *) abs=`pwd`"/$lib" ;;
84289322 esac
8429 newdlfiles="$newdlfiles $abs"
9323 func_append newdlfiles " $abs"
84309324 done
84319325 dlfiles="$newdlfiles"
84329326 newdlprefiles=
84359329 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
84369330 *) abs=`pwd`"/$lib" ;;
84379331 esac
8438 newdlprefiles="$newdlprefiles $abs"
9332 func_append newdlprefiles " $abs"
84399333 done
84409334 dlprefiles="$newdlprefiles"
84419335 fi
85209414 exit $EXIT_SUCCESS
85219415 }
85229416
8523 { test "$mode" = link || test "$mode" = relink; } &&
9417 { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
85249418 func_mode_link ${1+"$@"}
85259419
85269420
85409434 for arg
85419435 do
85429436 case $arg in
8543 -f) RM="$RM $arg"; rmforce=yes ;;
8544 -*) RM="$RM $arg" ;;
8545 *) files="$files $arg" ;;
9437 -f) func_append RM " $arg"; rmforce=yes ;;
9438 -*) func_append RM " $arg" ;;
9439 *) func_append files " $arg" ;;
85469440 esac
85479441 done
85489442
85519445
85529446 rmdirs=
85539447
8554 origobjdir="$objdir"
85559448 for file in $files; do
85569449 func_dirname "$file" "" "."
85579450 dir="$func_dirname_result"
85589451 if test "X$dir" = X.; then
8559 objdir="$origobjdir"
9452 odir="$objdir"
85609453 else
8561 objdir="$dir/$origobjdir"
9454 odir="$dir/$objdir"
85629455 fi
85639456 func_basename "$file"
85649457 name="$func_basename_result"
8565 test "$mode" = uninstall && objdir="$dir"
8566
8567 # Remember objdir for removal later, being careful to avoid duplicates
8568 if test "$mode" = clean; then
9458 test "$opt_mode" = uninstall && odir="$dir"
9459
9460 # Remember odir for removal later, being careful to avoid duplicates
9461 if test "$opt_mode" = clean; then
85699462 case " $rmdirs " in
8570 *" $objdir "*) ;;
8571 *) rmdirs="$rmdirs $objdir" ;;
9463 *" $odir "*) ;;
9464 *) func_append rmdirs " $odir" ;;
85729465 esac
85739466 fi
85749467
85949487
85959488 # Delete the libtool libraries and symlinks.
85969489 for n in $library_names; do
8597 rmfiles="$rmfiles $objdir/$n"
9490 func_append rmfiles " $odir/$n"
85989491 done
8599 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
8600
8601 case "$mode" in
9492 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
9493
9494 case "$opt_mode" in
86029495 clean)
8603 case " $library_names " in
8604 # " " in the beginning catches empty $dlname
9496 case " $library_names " in
86059497 *" $dlname "*) ;;
8606 *) rmfiles="$rmfiles $objdir/$dlname" ;;
9498 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
86079499 esac
8608 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
9500 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
86099501 ;;
86109502 uninstall)
86119503 if test -n "$library_names"; then
86339525 # Add PIC object to the list of files to remove.
86349526 if test -n "$pic_object" &&
86359527 test "$pic_object" != none; then
8636 rmfiles="$rmfiles $dir/$pic_object"
9528 func_append rmfiles " $dir/$pic_object"
86379529 fi
86389530
86399531 # Add non-PIC object to the list of files to remove.
86409532 if test -n "$non_pic_object" &&
86419533 test "$non_pic_object" != none; then
8642 rmfiles="$rmfiles $dir/$non_pic_object"
9534 func_append rmfiles " $dir/$non_pic_object"
86439535 fi
86449536 fi
86459537 ;;
86469538
86479539 *)
8648 if test "$mode" = clean ; then
9540 if test "$opt_mode" = clean ; then
86499541 noexename=$name
86509542 case $file in
86519543 *.exe)
86559547 noexename=$func_stripname_result
86569548 # $file with .exe has already been added to rmfiles,
86579549 # add $file without .exe
8658 rmfiles="$rmfiles $file"
9550 func_append rmfiles " $file"
86599551 ;;
86609552 esac
86619553 # Do a test to see if this is a libtool program.
86649556 func_ltwrapper_scriptname "$file"
86659557 relink_command=
86669558 func_source $func_ltwrapper_scriptname_result
8667 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
9559 func_append rmfiles " $func_ltwrapper_scriptname_result"
86689560 else
86699561 relink_command=
86709562 func_source $dir/$noexename
86729564
86739565 # note $name still contains .exe if it was in $file originally
86749566 # as does the version of $file that was added into $rmfiles
8675 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
9567 func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
86769568 if test "$fast_install" = yes && test -n "$relink_command"; then
8677 rmfiles="$rmfiles $objdir/lt-$name"
9569 func_append rmfiles " $odir/lt-$name"
86789570 fi
86799571 if test "X$noexename" != "X$name" ; then
8680 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
9572 func_append rmfiles " $odir/lt-${noexename}.c"
86819573 fi
86829574 fi
86839575 fi
86859577 esac
86869578 func_show_eval "$RM $rmfiles" 'exit_status=1'
86879579 done
8688 objdir="$origobjdir"
86899580
86909581 # Try to remove the ${objdir}s in the directories where we deleted files
86919582 for dir in $rmdirs; do
86979588 exit $exit_status
86989589 }
86999590
8700 { test "$mode" = uninstall || test "$mode" = clean; } &&
9591 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
87019592 func_mode_uninstall ${1+"$@"}
87029593
8703 test -z "$mode" && {
9594 test -z "$opt_mode" && {
87049595 help="$generic_help"
87059596 func_fatal_help "you must specify a MODE"
87069597 }
87079598
87089599 test -z "$exec_cmd" && \
8709 func_fatal_help "invalid operation mode \`$mode'"
9600 func_fatal_help "invalid operation mode \`$opt_mode'"
87109601
87119602 if test -n "$exec_cmd"; then
87129603 eval exec "$exec_cmd"
167167 dnl
168168 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
169169 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
170 m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
170171 m4_require([_LT_CMD_RELOAD])dnl
171172 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
173 m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
172174 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
173175 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
176 m4_require([_LT_WITH_SYSROOT])dnl
174177
175178 _LT_CONFIG_LIBTOOL_INIT([
176179 # See if we are running on zsh, and set the options which allow our
747750 # if finds mixed CR/LF and LF-only lines. Since sed operates in
748751 # text mode, it properly converts lines to CR/LF. This bash problem
749752 # is reportedly fixed, but why not run on old versions too?
750 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
751 || (rm -f "$cfgfile"; exit 1)
752
753 _LT_PROG_XSI_SHELLFNS
754
755 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
756 || (rm -f "$cfgfile"; exit 1)
757
758 mv -f "$cfgfile" "$ofile" ||
753 sed '$q' "$ltmain" >> "$cfgfile" \
754 || (rm -f "$cfgfile"; exit 1)
755
756 _LT_PROG_REPLACE_SHELLFNS
757
758 mv -f "$cfgfile" "$ofile" ||
759759 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
760760 chmod +x "$ofile"
761761 ],
10721072 fi
10731073 ])
10741074
1075 # _LT_SYS_MODULE_PATH_AIX
1076 # -----------------------
1075 # _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1076 # ----------------------------------
10771077 # Links a minimal program and checks the executable
10781078 # for the system default hardcoded library path. In most cases,
10791079 # this is /usr/lib:/lib, but when the MPI compilers are used
10801080 # the location of the communication and MPI libs are included too.
10811081 # If we don't find anything, use the default library path according
10821082 # to the aix ld manual.
1083 # Store the results from the different compilers for each TAGNAME.
1084 # Allow to override them for all tags through lt_cv_aix_libpath.
10831085 m4_defun([_LT_SYS_MODULE_PATH_AIX],
10841086 [m4_require([_LT_DECL_SED])dnl
1085 AC_LINK_IFELSE(AC_LANG_PROGRAM,[
1086 lt_aix_libpath_sed='
1087 /Import File Strings/,/^$/ {
1088 /^0/ {
1089 s/^0 *\(.*\)$/\1/
1090 p
1091 }
1092 }'
1093 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1094 # Check for a 64-bit object if we didn't find anything.
1095 if test -z "$aix_libpath"; then
1096 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1097 fi],[])
1098 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1087 if test "${lt_cv_aix_libpath+set}" = set; then
1088 aix_libpath=$lt_cv_aix_libpath
1089 else
1090 AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1091 [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1092 lt_aix_libpath_sed='[
1093 /Import File Strings/,/^$/ {
1094 /^0/ {
1095 s/^0 *\([^ ]*\) *$/\1/
1096 p
1097 }
1098 }]'
1099 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1100 # Check for a 64-bit object if we didn't find anything.
1101 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1102 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1103 fi],[])
1104 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1105 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1106 fi
1107 ])
1108 aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1109 fi
10991110 ])# _LT_SYS_MODULE_PATH_AIX
11001111
11011112
11201131
11211132 AC_MSG_CHECKING([how to print strings])
11221133 # Test print first, because it will be a builtin if present.
1123 if test "X`print -r -- -n 2>/dev/null`" = X-n && \
1134 if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
11241135 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
11251136 ECHO='print -r --'
11261137 elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
11631174 _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
11641175 ])# _LT_PROG_ECHO_BACKSLASH
11651176
1177
1178 # _LT_WITH_SYSROOT
1179 # ----------------
1180 AC_DEFUN([_LT_WITH_SYSROOT],
1181 [AC_MSG_CHECKING([for sysroot])
1182 AC_ARG_WITH([sysroot],
1183 [ --with-sysroot[=DIR] Search for dependent libraries within DIR
1184 (or the compiler's sysroot if not specified).],
1185 [], [with_sysroot=no])
1186
1187 dnl lt_sysroot will always be passed unquoted. We quote it here
1188 dnl in case the user passed a directory name.
1189 lt_sysroot=
1190 case ${with_sysroot} in #(
1191 yes)
1192 if test "$GCC" = yes; then
1193 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1194 fi
1195 ;; #(
1196 /*)
1197 lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1198 ;; #(
1199 no|'')
1200 ;; #(
1201 *)
1202 AC_MSG_RESULT([${with_sysroot}])
1203 AC_MSG_ERROR([The sysroot must be an absolute path.])
1204 ;;
1205 esac
1206
1207 AC_MSG_RESULT([${lt_sysroot:-no}])
1208 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1209 [dependent libraries, and in which our libraries should be installed.])])
11661210
11671211 # _LT_ENABLE_LOCK
11681212 # ---------------
13101354 ])# _LT_ENABLE_LOCK
13111355
13121356
1357 # _LT_PROG_AR
1358 # -----------
1359 m4_defun([_LT_PROG_AR],
1360 [AC_CHECK_TOOLS(AR, [ar], false)
1361 : ${AR=ar}
1362 : ${AR_FLAGS=cru}
1363 _LT_DECL([], [AR], [1], [The archiver])
1364 _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1365
1366 AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1367 [lt_cv_ar_at_file=no
1368 AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1369 [echo conftest.$ac_objext > conftest.lst
1370 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1371 AC_TRY_EVAL([lt_ar_try])
1372 if test "$ac_status" -eq 0; then
1373 # Ensure the archiver fails upon bogus file names.
1374 rm -f conftest.$ac_objext libconftest.a
1375 AC_TRY_EVAL([lt_ar_try])
1376 if test "$ac_status" -ne 0; then
1377 lt_cv_ar_at_file=@
1378 fi
1379 fi
1380 rm -f conftest.* libconftest.a
1381 ])
1382 ])
1383
1384 if test "x$lt_cv_ar_at_file" = xno; then
1385 archiver_list_spec=
1386 else
1387 archiver_list_spec=$lt_cv_ar_at_file
1388 fi
1389 _LT_DECL([], [archiver_list_spec], [1],
1390 [How to feed a file listing to the archiver])
1391 ])# _LT_PROG_AR
1392
1393
13131394 # _LT_CMD_OLD_ARCHIVE
13141395 # -------------------
13151396 m4_defun([_LT_CMD_OLD_ARCHIVE],
1316 [AC_CHECK_TOOL(AR, ar, false)
1317 test -z "$AR" && AR=ar
1318 test -z "$AR_FLAGS" && AR_FLAGS=cru
1319 _LT_DECL([], [AR], [1], [The archiver])
1320 _LT_DECL([], [AR_FLAGS], [1])
1397 [_LT_PROG_AR
13211398
13221399 AC_CHECK_TOOL(STRIP, strip, :)
13231400 test -z "$STRIP" && STRIP=:
16571734 /* When -fvisbility=hidden is used, assume the code has been annotated
16581735 correspondingly for the symbols needed. */
16591736 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1660 void fnord () __attribute__((visibility("default")));
1737 int fnord () __attribute__((visibility("default")));
16611738 #endif
16621739
1663 void fnord () { int i=42; }
1740 int fnord () { return 42; }
16641741 int main ()
16651742 {
16661743 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
22002277 need_version=no
22012278 need_lib_prefix=no
22022279
2203 case $GCC,$host_os in
2204 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2280 case $GCC,$cc_basename in
2281 yes,*)
2282 # gcc
22052283 library_names_spec='$libname.dll.a'
22062284 # DLL is installed to $(libdir)/../bin by postinstall_cmds
22072285 postinstall_cmds='base_file=`basename \${file}`~
22342312 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
22352313 ;;
22362314 esac
2315 dynamic_linker='Win32 ld.exe'
22372316 ;;
22382317
2318 *,cl*)
2319 # Native MSVC
2320 libname_spec='$name'
2321 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2322 library_names_spec='${libname}.dll.lib'
2323
2324 case $build_os in
2325 mingw*)
2326 sys_lib_search_path_spec=
2327 lt_save_ifs=$IFS
2328 IFS=';'
2329 for lt_path in $LIB
2330 do
2331 IFS=$lt_save_ifs
2332 # Let DOS variable expansion print the short 8.3 style file name.
2333 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2334 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2335 done
2336 IFS=$lt_save_ifs
2337 # Convert to MSYS style.
2338 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2339 ;;
2340 cygwin*)
2341 # Convert to unix form, then to dos form, then back to unix form
2342 # but this time dos style (no spaces!) so that the unix form looks
2343 # like /cygdrive/c/PROGRA~1:/cygdr...
2344 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2345 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2346 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2347 ;;
2348 *)
2349 sys_lib_search_path_spec="$LIB"
2350 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2351 # It is most probably a Windows format PATH.
2352 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2353 else
2354 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2355 fi
2356 # FIXME: find the short name or the path components, as spaces are
2357 # common. (e.g. "Program Files" -> "PROGRA~1")
2358 ;;
2359 esac
2360
2361 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2362 postinstall_cmds='base_file=`basename \${file}`~
2363 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2364 dldir=$destdir/`dirname \$dlpath`~
2365 test -d \$dldir || mkdir -p \$dldir~
2366 $install_prog $dir/$dlname \$dldir/$dlname'
2367 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2368 dlpath=$dir/\$dldll~
2369 $RM \$dlpath'
2370 shlibpath_overrides_runpath=yes
2371 dynamic_linker='Win32 link.exe'
2372 ;;
2373
22392374 *)
2375 # Assume MSVC wrapper
22402376 library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2377 dynamic_linker='Win32 ld.exe'
22412378 ;;
22422379 esac
2243 dynamic_linker='Win32 ld.exe'
22442380 # FIXME: first we should search . and the directory the executable is in
22452381 shlibpath_var=PATH
22462382 ;;
29483084 esac
29493085 reload_cmds='$LD$reload_flag -o $output$reload_objs'
29503086 case $host_os in
3087 cygwin* | mingw* | pw32* | cegcc*)
3088 if test "$GCC" != yes; then
3089 reload_cmds=false
3090 fi
3091 ;;
29513092 darwin*)
29523093 if test "$GCC" = yes; then
29533094 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
31663307 ;;
31673308 esac
31683309 ])
3310
3311 file_magic_glob=
3312 want_nocaseglob=no
3313 if test "$build" = "$host"; then
3314 case $host_os in
3315 mingw* | pw32*)
3316 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3317 want_nocaseglob=yes
3318 else
3319 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3320 fi
3321 ;;
3322 esac
3323 fi
3324
31693325 file_magic_cmd=$lt_cv_file_magic_cmd
31703326 deplibs_check_method=$lt_cv_deplibs_check_method
31713327 test -z "$deplibs_check_method" && deplibs_check_method=unknown
31733329 _LT_DECL([], [deplibs_check_method], [1],
31743330 [Method to check whether dependent libraries are shared objects])
31753331 _LT_DECL([], [file_magic_cmd], [1],
3176 [Command to use when deplibs_check_method == "file_magic"])
3332 [Command to use when deplibs_check_method = "file_magic"])
3333 _LT_DECL([], [file_magic_glob], [1],
3334 [How to find potential files when deplibs_check_method = "file_magic"])
3335 _LT_DECL([], [want_nocaseglob], [1],
3336 [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
31773337 ])# _LT_CHECK_MAGIC_METHOD
31783338
31793339
32763436 dnl AC_DEFUN([AM_PROG_NM], [])
32773437 dnl AC_DEFUN([AC_PROG_NM], [])
32783438
3439 # _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3440 # --------------------------------
3441 # how to determine the name of the shared library
3442 # associated with a specific link library.
3443 # -- PORTME fill in with the dynamic library characteristics
3444 m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3445 [m4_require([_LT_DECL_EGREP])
3446 m4_require([_LT_DECL_OBJDUMP])
3447 m4_require([_LT_DECL_DLLTOOL])
3448 AC_CACHE_CHECK([how to associate runtime and link libraries],
3449 lt_cv_sharedlib_from_linklib_cmd,
3450 [lt_cv_sharedlib_from_linklib_cmd='unknown'
3451
3452 case $host_os in
3453 cygwin* | mingw* | pw32* | cegcc*)
3454 # two different shell functions defined in ltmain.sh
3455 # decide which to use based on capabilities of $DLLTOOL
3456 case `$DLLTOOL --help 2>&1` in
3457 *--identify-strict*)
3458 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3459 ;;
3460 *)
3461 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3462 ;;
3463 esac
3464 ;;
3465 *)
3466 # fallback: assume linklib IS sharedlib
3467 lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3468 ;;
3469 esac
3470 ])
3471 sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3472 test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3473
3474 _LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3475 [Command to associate shared and link libraries])
3476 ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3477
3478
3479 # _LT_PATH_MANIFEST_TOOL
3480 # ----------------------
3481 # locate the manifest tool
3482 m4_defun([_LT_PATH_MANIFEST_TOOL],
3483 [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3484 test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3485 AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3486 [lt_cv_path_mainfest_tool=no
3487 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3488 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3489 cat conftest.err >&AS_MESSAGE_LOG_FD
3490 if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3491 lt_cv_path_mainfest_tool=yes
3492 fi
3493 rm -f conftest*])
3494 if test "x$lt_cv_path_mainfest_tool" != xyes; then
3495 MANIFEST_TOOL=:
3496 fi
3497 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3498 ])# _LT_PATH_MANIFEST_TOOL
3499
32793500
32803501 # LT_LIB_M
32813502 # --------
34023623 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
34033624
34043625 # Transform an extracted symbol line into symbol name and symbol address
3405 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
3406 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
3626 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
3627 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
34073628
34083629 # Handle CRLF in mingw tool chain
34093630 opt_cr=
34393660 else
34403661 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
34413662 fi
3663 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
34423664
34433665 # Check to see that the pipe works correctly.
34443666 pipe_works=no
34723694 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
34733695 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
34743696 cat <<_LT_EOF > conftest.$ac_ext
3697 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3698 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3699 /* DATA imports from DLLs on WIN32 con't be const, because runtime
3700 relocations are performed -- see ld's documentation on pseudo-relocs. */
3701 # define LT@&t@_DLSYM_CONST
3702 #elif defined(__osf__)
3703 /* This system does not cope well with relocations in const data. */
3704 # define LT@&t@_DLSYM_CONST
3705 #else
3706 # define LT@&t@_DLSYM_CONST const
3707 #endif
3708
34753709 #ifdef __cplusplus
34763710 extern "C" {
34773711 #endif
34833717 cat <<_LT_EOF >> conftest.$ac_ext
34843718
34853719 /* The mapping between symbol names and symbols. */
3486 const struct {
3720 LT@&t@_DLSYM_CONST struct {
34873721 const char *name;
34883722 void *address;
34893723 }
35093743 _LT_EOF
35103744 # Now try linking the two files.
35113745 mv conftest.$ac_objext conftstm.$ac_objext
3512 lt_save_LIBS="$LIBS"
3513 lt_save_CFLAGS="$CFLAGS"
3746 lt_globsym_save_LIBS=$LIBS
3747 lt_globsym_save_CFLAGS=$CFLAGS
35143748 LIBS="conftstm.$ac_objext"
35153749 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
35163750 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
35173751 pipe_works=yes
35183752 fi
3519 LIBS="$lt_save_LIBS"
3520 CFLAGS="$lt_save_CFLAGS"
3753 LIBS=$lt_globsym_save_LIBS
3754 CFLAGS=$lt_globsym_save_CFLAGS
35213755 else
35223756 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
35233757 fi
35503784 AC_MSG_RESULT(ok)
35513785 fi
35523786
3787 # Response file support.
3788 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3789 nm_file_list_spec='@'
3790 elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
3791 nm_file_list_spec='@'
3792 fi
3793
35533794 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
35543795 [Take the output of nm and produce a listing of raw symbols and C names])
35553796 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
35603801 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
35613802 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
35623803 [Transform the output of nm in a C name address pair when lib prefix is needed])
3804 _LT_DECL([], [nm_file_list_spec], [1],
3805 [Specify filename containing input files for $NM])
35633806 ]) # _LT_CMD_GLOBAL_SYMBOLS
35643807
35653808
35713814 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
35723815 _LT_TAGVAR(lt_prog_compiler_static, $1)=
35733816
3574 AC_MSG_CHECKING([for $compiler option to produce PIC])
35753817 m4_if([$1], [CXX], [
35763818 # C++ specific cases for pic, static, wl, etc.
35773819 if test "$GXX" = yes; then
36753917 # _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"
36763918 ;;
36773919 esac
3920 ;;
3921 mingw* | cygwin* | os2* | pw32* | cegcc*)
3922 # This hack is so that the source file can tell whether it is being
3923 # built for inclusion in a dll (and should export symbols for example).
3924 m4_if([$1], [GCJ], [],
3925 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
36783926 ;;
36793927 dgux*)
36803928 case $cc_basename in
40504298 _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
40514299 _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
40524300 ;;
4301 nagfor*)
4302 # NAG Fortran compiler
4303 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4304 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4305 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4306 ;;
40534307 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
40544308 # Portland Group compilers (*not* the Pentium gcc compiler,
40554309 # which looks to be a dead project)
41694423 _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
41704424 ;;
41714425 esac
4172 AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4173 _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4174 [How to pass a linker flag through the compiler])
4426
4427 AC_CACHE_CHECK([for $compiler option to produce PIC],
4428 [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4429 [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4430 _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
41754431
41764432 #
41774433 # Check to make sure the PIC flag actually works.
41904446 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
41914447 [Additional compiler flags for building library objects])
41924448
4449 _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4450 [How to pass a linker flag through the compiler])
41934451 #
41944452 # Check to make sure the static flag actually works.
41954453 #
42104468 m4_defun([_LT_LINKER_SHLIBS],
42114469 [AC_REQUIRE([LT_PATH_LD])dnl
42124470 AC_REQUIRE([LT_PATH_NM])dnl
4471 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
42134472 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
42144473 m4_require([_LT_DECL_EGREP])dnl
42154474 m4_require([_LT_DECL_SED])dnl
42184477 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
42194478 m4_if([$1], [CXX], [
42204479 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4480 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
42214481 case $host_os in
42224482 aix[[4-9]]*)
42234483 # If we're using GNU nm, then we don't want the "-C" option.
42324492 ;;
42334493 pw32*)
42344494 _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4235 ;;
4495 ;;
42364496 cygwin* | mingw* | cegcc*)
4237 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4238 ;;
4497 case $cc_basename in
4498 cl*) ;;
4499 *)
4500 _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'
4501 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4502 ;;
4503 esac
4504 ;;
42394505 *)
42404506 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4241 ;;
4507 ;;
42424508 esac
4243 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
42444509 ], [
42454510 runpath_var=
42464511 _LT_TAGVAR(allow_undefined_flag, $1)=
44084673 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
44094674 _LT_TAGVAR(always_export_symbols, $1)=no
44104675 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4411 _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'
4676 _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'
4677 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
44124678
44134679 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
44144680 _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'
44564722 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
44574723 && test "$tmp_diet" = no
44584724 then
4459 tmp_addflag=
4725 tmp_addflag=' $pic_flag'
44604726 tmp_sharedflag='-shared'
44614727 case $cc_basename,$host_cpu in
44624728 pgcc*) # Portland Group C compiler
45264792 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
45274793 wlarc=
45284794 else
4529 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4530 _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'
4795 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4796 _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'
45314797 fi
45324798 ;;
45334799
45454811
45464812 _LT_EOF
45474813 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4548 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4549 _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'
4814 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4815 _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'
45504816 else
45514817 _LT_TAGVAR(ld_shlibs, $1)=no
45524818 fi
45924858
45934859 *)
45944860 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4595 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4596 _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'
4861 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4862 _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'
45974863 else
45984864 _LT_TAGVAR(ld_shlibs, $1)=no
45994865 fi
47234989 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
47244990 # Determine the default libpath from the value encoded in an
47254991 # empty executable.
4726 _LT_SYS_MODULE_PATH_AIX
4992 _LT_SYS_MODULE_PATH_AIX([$1])
47274993 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
47284994 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
47294995 else
47345000 else
47355001 # Determine the default libpath from the value encoded in an
47365002 # empty executable.
4737 _LT_SYS_MODULE_PATH_AIX
5003 _LT_SYS_MODULE_PATH_AIX([$1])
47385004 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
47395005 # Warning - without using the other run time loading flags,
47405006 # -berok will link without error, but may produce a broken library.
47785044 # Microsoft Visual C++.
47795045 # hardcode_libdir_flag_spec is actually meaningless, as there is
47805046 # no search path for DLLs.
4781 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4782 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4783 # Tell ltmain to make .lib files, not .a files.
4784 libext=lib
4785 # Tell ltmain to make .dll files, not .so files.
4786 shrext_cmds=".dll"
4787 # FIXME: Setting linknames here is a bad hack.
4788 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
4789 # The linker will automatically build a .lib file if we build a DLL.
4790 _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4791 # FIXME: Should let the user specify the lib program.
4792 _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4793 _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4794 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5047 case $cc_basename in
5048 cl*)
5049 # Native MSVC
5050 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5051 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5052 _LT_TAGVAR(always_export_symbols, $1)=yes
5053 _LT_TAGVAR(file_list_spec, $1)='@'
5054 # Tell ltmain to make .lib files, not .a files.
5055 libext=lib
5056 # Tell ltmain to make .dll files, not .so files.
5057 shrext_cmds=".dll"
5058 # FIXME: Setting linknames here is a bad hack.
5059 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5060 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5061 sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5062 else
5063 sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5064 fi~
5065 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5066 linknames='
5067 # The linker will not automatically build a static lib if we build a DLL.
5068 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5069 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5070 _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'
5071 # Don't use ranlib
5072 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5073 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5074 lt_tool_outputfile="@TOOL_OUTPUT@"~
5075 case $lt_outputfile in
5076 *.exe|*.EXE) ;;
5077 *)
5078 lt_outputfile="$lt_outputfile.exe"
5079 lt_tool_outputfile="$lt_tool_outputfile.exe"
5080 ;;
5081 esac~
5082 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5083 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5084 $RM "$lt_outputfile.manifest";
5085 fi'
5086 ;;
5087 *)
5088 # Assume MSVC wrapper
5089 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5090 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5091 # Tell ltmain to make .lib files, not .a files.
5092 libext=lib
5093 # Tell ltmain to make .dll files, not .so files.
5094 shrext_cmds=".dll"
5095 # FIXME: Setting linknames here is a bad hack.
5096 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5097 # The linker will automatically build a .lib file if we build a DLL.
5098 _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5099 # FIXME: Should let the user specify the lib program.
5100 _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5101 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5102 ;;
5103 esac
47955104 ;;
47965105
47975106 darwin* | rhapsody*)
48295138
48305139 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
48315140 freebsd* | dragonfly*)
4832 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5141 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
48335142 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
48345143 _LT_TAGVAR(hardcode_direct, $1)=yes
48355144 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48375146
48385147 hpux9*)
48395148 if test "$GCC" = yes; then
4840 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5149 _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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
48415150 else
48425151 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
48435152 fi
48535162
48545163 hpux10*)
48555164 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
4856 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5165 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
48575166 else
48585167 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
48595168 fi
48775186 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
48785187 ;;
48795188 ia64*)
4880 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5189 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
48815190 ;;
48825191 *)
4883 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5192 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
48845193 ;;
48855194 esac
48865195 else
49275236
49285237 irix5* | irix6* | nonstopux*)
49295238 if test "$GCC" = yes; then
4930 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $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'
5239 _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'
49315240 # Try to use the -exported_symbol ld option, if it does not
49325241 # work, assume that -exports_file does not work either and
49335242 # implicitly export all symbols.
4934 save_LDFLAGS="$LDFLAGS"
4935 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4936 AC_LINK_IFELSE(int foo(void) {},
4937 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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'
4938 )
4939 LDFLAGS="$save_LDFLAGS"
5243 # This should be the same for all languages, so no per-tag cache variable.
5244 AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5245 [lt_cv_irix_exported_symbol],
5246 [save_LDFLAGS="$LDFLAGS"
5247 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5248 AC_LINK_IFELSE(
5249 [AC_LANG_SOURCE(
5250 [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5251 [C++], [[int foo (void) { return 0; }]],
5252 [Fortran 77], [[
5253 subroutine foo
5254 end]],
5255 [Fortran], [[
5256 subroutine foo
5257 end]])])],
5258 [lt_cv_irix_exported_symbol=yes],
5259 [lt_cv_irix_exported_symbol=no])
5260 LDFLAGS="$save_LDFLAGS"])
5261 if test "$lt_cv_irix_exported_symbol" = yes; then
5262 _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'
5263 fi
49405264 else
49415265 _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'
49425266 _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'
50215345 osf4* | osf5*) # as osf3* with the addition of -msym flag
50225346 if test "$GCC" = yes; then
50235347 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5024 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_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'
5348 _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'
50255349 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
50265350 else
50275351 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
50405364 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
50415365 if test "$GCC" = yes; then
50425366 wlarc='${wl}'
5043 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5367 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
50445368 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5045 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5369 $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'
50465370 else
50475371 case `$CC -V 2>&1` in
50485372 *"Compilers 5.0"*)
53145638 to runtime path list])
53155639 _LT_TAGDECL([], [link_all_deplibs], [0],
53165640 [Whether libtool must link a program against all its dependency libraries])
5317 _LT_TAGDECL([], [fix_srcfile_path], [1],
5318 [Fix the shell variable $srcfile for the compiler])
53195641 _LT_TAGDECL([], [always_export_symbols], [0],
53205642 [Set to "yes" if exported symbols are required])
53215643 _LT_TAGDECL([], [export_symbols_cmds], [2],
53265648 [Symbols that must always be exported])
53275649 _LT_TAGDECL([], [prelink_cmds], [2],
53285650 [Commands necessary for linking programs (against libraries) with templates])
5651 _LT_TAGDECL([], [postlink_cmds], [2],
5652 [Commands necessary for finishing linking programs])
53295653 _LT_TAGDECL([], [file_list_spec], [1],
53305654 [Specify filename containing input files])
53315655 dnl FIXME: Not yet implemented
54275751 m4_defun([_LT_LANG_CXX_CONFIG],
54285752 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
54295753 m4_require([_LT_DECL_EGREP])dnl
5754 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
54305755 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
54315756 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
54325757 (test "X$CXX" != "Xg++"))) ; then
54885813
54895814 # Allow CC to be a program name with arguments.
54905815 lt_save_CC=$CC
5816 lt_save_CFLAGS=$CFLAGS
54915817 lt_save_LD=$LD
54925818 lt_save_GCC=$GCC
54935819 GCC=$GXX
55055831 fi
55065832 test -z "${LDCXX+set}" || LD=$LDCXX
55075833 CC=${CXX-"c++"}
5834 CFLAGS=$CXXFLAGS
55085835 compiler=$CC
55095836 _LT_TAGVAR(compiler, $1)=$CC
55105837 _LT_CC_BASENAME([$compiler])
55265853 # Check if GNU C++ uses GNU ld as the underlying linker, since the
55275854 # archiving commands below assume that GNU ld is being used.
55285855 if test "$with_gnu_ld" = yes; then
5529 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5530 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5856 _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5857 _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'
55315858
55325859 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
55335860 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
56685995 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
56695996 # Determine the default libpath from the value encoded in an empty
56705997 # executable.
5671 _LT_SYS_MODULE_PATH_AIX
5998 _LT_SYS_MODULE_PATH_AIX([$1])
56725999 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
56736000
56746001 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
56806007 else
56816008 # Determine the default libpath from the value encoded in an
56826009 # empty executable.
5683 _LT_SYS_MODULE_PATH_AIX
6010 _LT_SYS_MODULE_PATH_AIX([$1])
56846011 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
56856012 # Warning - without using the other run time loading flags,
56866013 # -berok will link without error, but may produce a broken library.
57226049 ;;
57236050
57246051 cygwin* | mingw* | pw32* | cegcc*)
5725 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5726 # as there is no search path for DLLs.
5727 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5728 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5729 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5730 _LT_TAGVAR(always_export_symbols, $1)=no
5731 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5732
5733 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5734 _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'
5735 # If the export-symbols file already is a .def file (1st line
5736 # is EXPORTS), use it as is; otherwise, prepend...
5737 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5738 cp $export_symbols $output_objdir/$soname.def;
5739 else
5740 echo EXPORTS > $output_objdir/$soname.def;
5741 cat $export_symbols >> $output_objdir/$soname.def;
5742 fi~
5743 $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'
5744 else
5745 _LT_TAGVAR(ld_shlibs, $1)=no
5746 fi
5747 ;;
6052 case $GXX,$cc_basename in
6053 ,cl* | no,cl*)
6054 # Native MSVC
6055 # hardcode_libdir_flag_spec is actually meaningless, as there is
6056 # no search path for DLLs.
6057 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6058 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6059 _LT_TAGVAR(always_export_symbols, $1)=yes
6060 _LT_TAGVAR(file_list_spec, $1)='@'
6061 # Tell ltmain to make .lib files, not .a files.
6062 libext=lib
6063 # Tell ltmain to make .dll files, not .so files.
6064 shrext_cmds=".dll"
6065 # FIXME: Setting linknames here is a bad hack.
6066 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6067 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6068 $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6069 else
6070 $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6071 fi~
6072 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6073 linknames='
6074 # The linker will not automatically build a static lib if we build a DLL.
6075 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6076 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6077 # Don't use ranlib
6078 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6079 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6080 lt_tool_outputfile="@TOOL_OUTPUT@"~
6081 case $lt_outputfile in
6082 *.exe|*.EXE) ;;
6083 *)
6084 lt_outputfile="$lt_outputfile.exe"
6085 lt_tool_outputfile="$lt_tool_outputfile.exe"
6086 ;;
6087 esac~
6088 func_to_tool_file "$lt_outputfile"~
6089 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6090 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6091 $RM "$lt_outputfile.manifest";
6092 fi'
6093 ;;
6094 *)
6095 # g++
6096 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6097 # as there is no search path for DLLs.
6098 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6099 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6100 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6101 _LT_TAGVAR(always_export_symbols, $1)=no
6102 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6103
6104 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6105 _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'
6106 # If the export-symbols file already is a .def file (1st line
6107 # is EXPORTS), use it as is; otherwise, prepend...
6108 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6109 cp $export_symbols $output_objdir/$soname.def;
6110 else
6111 echo EXPORTS > $output_objdir/$soname.def;
6112 cat $export_symbols >> $output_objdir/$soname.def;
6113 fi~
6114 $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'
6115 else
6116 _LT_TAGVAR(ld_shlibs, $1)=no
6117 fi
6118 ;;
6119 esac
6120 ;;
57486121 darwin* | rhapsody*)
57496122 _LT_DARWIN_LINKER_FEATURES($1)
57506123 ;;
58196192 ;;
58206193 *)
58216194 if test "$GXX" = yes; then
5822 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6195 _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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
58236196 else
58246197 # FIXME: insert proper C++ library support
58256198 _LT_TAGVAR(ld_shlibs, $1)=no
58906263 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
58916264 ;;
58926265 ia64*)
5893 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6266 _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'
58946267 ;;
58956268 *)
5896 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6269 _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'
58976270 ;;
58986271 esac
58996272 fi
59346307 *)
59356308 if test "$GXX" = yes; then
59366309 if test "$with_gnu_ld" = no; then
5937 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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'
6310 _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'
59386311 else
5939 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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'
6312 _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'
59406313 fi
59416314 fi
59426315 _LT_TAGVAR(link_all_deplibs, $1)=yes
62146587 _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'
62156588 ;;
62166589 *)
6217 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6590 _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'
62186591 ;;
62196592 esac
62206593
63016674 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
63026675 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
63036676 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6304 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6677 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
63056678 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6306 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6679 $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
63076680
63086681 # Commands to make compiler produce verbose output that lists
63096682 # what "hidden" libraries, object files and flags are used when
64326805 fi # test -n "$compiler"
64336806
64346807 CC=$lt_save_CC
6808 CFLAGS=$lt_save_CFLAGS
64356809 LDCXX=$LD
64366810 LD=$lt_save_LD
64376811 GCC=$lt_save_GCC
64466820 ])# _LT_LANG_CXX_CONFIG
64476821
64486822
6823 # _LT_FUNC_STRIPNAME_CNF
6824 # ----------------------
6825 # func_stripname_cnf prefix suffix name
6826 # strip PREFIX and SUFFIX off of NAME.
6827 # PREFIX and SUFFIX must not contain globbing or regex special
6828 # characters, hashes, percent signs, but SUFFIX may contain a leading
6829 # dot (in which case that matches only a dot).
6830 #
6831 # This function is identical to the (non-XSI) version of func_stripname,
6832 # except this one can be used by m4 code that may be executed by configure,
6833 # rather than the libtool script.
6834 m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
6835 AC_REQUIRE([_LT_DECL_SED])
6836 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
6837 func_stripname_cnf ()
6838 {
6839 case ${2} in
6840 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6841 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
6842 esac
6843 } # func_stripname_cnf
6844 ])# _LT_FUNC_STRIPNAME_CNF
6845
64496846 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
64506847 # ---------------------------------
64516848 # Figure out "hidden" library dependencies from verbose
64546851 # objects, libraries and library flags.
64556852 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
64566853 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6854 AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
64576855 # Dependencies to place before and after the object being linked:
64586856 _LT_TAGVAR(predep_objects, $1)=
64596857 _LT_TAGVAR(postdep_objects, $1)=
65046902 };
65056903 _LT_EOF
65066904 ])
6905
6906 _lt_libdeps_save_CFLAGS=$CFLAGS
6907 case "$CC $CFLAGS " in #(
6908 *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
6909 *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
6910 esac
6911
65076912 dnl Parse the compiler output and extract the necessary
65086913 dnl objects, libraries and library flags.
65096914 if AC_TRY_EVAL(ac_compile); then
65156920 pre_test_object_deps_done=no
65166921
65176922 for p in `eval "$output_verbose_link_cmd"`; do
6518 case $p in
6923 case ${prev}${p} in
65196924
65206925 -L* | -R* | -l*)
65216926 # Some compilers place space between "-{L,R}" and the path.
65246929 test $p = "-R"; then
65256930 prev=$p
65266931 continue
6527 else
6528 prev=
65296932 fi
65306933
6934 # Expand the sysroot to ease extracting the directories later.
6935 if test -z "$prev"; then
6936 case $p in
6937 -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
6938 -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
6939 -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
6940 esac
6941 fi
6942 case $p in
6943 =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
6944 esac
65316945 if test "$pre_test_object_deps_done" = no; then
6532 case $p in
6533 -L* | -R*)
6946 case ${prev} in
6947 -L | -R)
65346948 # Internal compiler library paths should come after those
65356949 # provided the user. The postdeps already come after the
65366950 # user supplied libs so there is no need to process them.
65506964 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
65516965 fi
65526966 fi
6967 prev=
65536968 ;;
65546969
6970 *.lto.$objext) ;; # Ignore GCC LTO objects
65556971 *.$objext)
65566972 # This assumes that the test object file only shows up
65576973 # once in the compiler output.
65877003 fi
65887004
65897005 $RM -f confest.$objext
7006 CFLAGS=$_lt_libdeps_save_CFLAGS
65907007
65917008 # PORTME: override above test on systems where it is broken
65927009 m4_if([$1], [CXX],
67367153 # Allow CC to be a program name with arguments.
67377154 lt_save_CC="$CC"
67387155 lt_save_GCC=$GCC
7156 lt_save_CFLAGS=$CFLAGS
67397157 CC=${F77-"f77"}
7158 CFLAGS=$FFLAGS
67407159 compiler=$CC
67417160 _LT_TAGVAR(compiler, $1)=$CC
67427161 _LT_CC_BASENAME([$compiler])
67907209
67917210 GCC=$lt_save_GCC
67927211 CC="$lt_save_CC"
7212 CFLAGS="$lt_save_CFLAGS"
67937213 fi # test "$_lt_disable_F77" != yes
67947214
67957215 AC_LANG_POP
68667286 # Allow CC to be a program name with arguments.
68677287 lt_save_CC="$CC"
68687288 lt_save_GCC=$GCC
7289 lt_save_CFLAGS=$CFLAGS
68697290 CC=${FC-"f95"}
7291 CFLAGS=$FCFLAGS
68707292 compiler=$CC
68717293 GCC=$ac_cv_fc_compiler_gnu
68727294
69227344 fi # test -n "$compiler"
69237345
69247346 GCC=$lt_save_GCC
6925 CC="$lt_save_CC"
7347 CC=$lt_save_CC
7348 CFLAGS=$lt_save_CFLAGS
69267349 fi # test "$_lt_disable_FC" != yes
69277350
69287351 AC_LANG_POP
69597382 _LT_LINKER_BOILERPLATE
69607383
69617384 # Allow CC to be a program name with arguments.
6962 lt_save_CC="$CC"
7385 lt_save_CC=$CC
7386 lt_save_CFLAGS=$CFLAGS
69637387 lt_save_GCC=$GCC
69647388 GCC=yes
69657389 CC=${GCJ-"gcj"}
7390 CFLAGS=$GCJFLAGS
69667391 compiler=$CC
69677392 _LT_TAGVAR(compiler, $1)=$CC
69687393 _LT_TAGVAR(LD, $1)="$LD"
69937418 AC_LANG_RESTORE
69947419
69957420 GCC=$lt_save_GCC
6996 CC="$lt_save_CC"
7421 CC=$lt_save_CC
7422 CFLAGS=$lt_save_CFLAGS
69977423 ])# _LT_LANG_GCJ_CONFIG
69987424
69997425
70287454
70297455 # Allow CC to be a program name with arguments.
70307456 lt_save_CC="$CC"
7457 lt_save_CFLAGS=$CFLAGS
70317458 lt_save_GCC=$GCC
70327459 GCC=
70337460 CC=${RC-"windres"}
7461 CFLAGS=
70347462 compiler=$CC
70357463 _LT_TAGVAR(compiler, $1)=$CC
70367464 _LT_CC_BASENAME([$compiler])
70437471
70447472 GCC=$lt_save_GCC
70457473 AC_LANG_RESTORE
7046 CC="$lt_save_CC"
7474 CC=$lt_save_CC
7475 CFLAGS=$lt_save_CFLAGS
70477476 ])# _LT_LANG_RC_CONFIG
70487477
70497478
71027531 AC_SUBST([OBJDUMP])
71037532 ])
71047533
7534 # _LT_DECL_DLLTOOL
7535 # ----------------
7536 # Ensure DLLTOOL variable is set.
7537 m4_defun([_LT_DECL_DLLTOOL],
7538 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7539 test -z "$DLLTOOL" && DLLTOOL=dlltool
7540 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
7541 AC_SUBST([DLLTOOL])
7542 ])
71057543
71067544 # _LT_DECL_SED
71077545 # ------------
71957633 # Try some XSI features
71967634 xsi_shell=no
71977635 ( _lt_dummy="a/b/c"
7198 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7199 = c,a/b,, \
7636 test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7637 = c,a/b,b/c, \
72007638 && eval 'test $(( 1 + 1 )) -eq 2 \
72017639 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
72027640 && xsi_shell=yes
72357673 ])# _LT_CHECK_SHELL_FEATURES
72367674
72377675
7238 # _LT_PROG_XSI_SHELLFNS
7239 # ---------------------
7240 # Bourne and XSI compatible variants of some useful shell functions.
7241 m4_defun([_LT_PROG_XSI_SHELLFNS],
7242 [case $xsi_shell in
7243 yes)
7244 cat << \_LT_EOF >> "$cfgfile"
7245
7246 # func_dirname file append nondir_replacement
7247 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
7248 # otherwise set result to NONDIR_REPLACEMENT.
7249 func_dirname ()
7250 {
7251 case ${1} in
7252 */*) func_dirname_result="${1%/*}${2}" ;;
7253 * ) func_dirname_result="${3}" ;;
7254 esac
7255 }
7256
7257 # func_basename file
7258 func_basename ()
7259 {
7260 func_basename_result="${1##*/}"
7261 }
7262
7263 # func_dirname_and_basename file append nondir_replacement
7264 # perform func_basename and func_dirname in a single function
7265 # call:
7266 # dirname: Compute the dirname of FILE. If nonempty,
7267 # add APPEND to the result, otherwise set result
7268 # to NONDIR_REPLACEMENT.
7269 # value returned in "$func_dirname_result"
7270 # basename: Compute filename of FILE.
7271 # value retuned in "$func_basename_result"
7272 # Implementation must be kept synchronized with func_dirname
7273 # and func_basename. For efficiency, we do not delegate to
7274 # those functions but instead duplicate the functionality here.
7275 func_dirname_and_basename ()
7276 {
7277 case ${1} in
7278 */*) func_dirname_result="${1%/*}${2}" ;;
7279 * ) func_dirname_result="${3}" ;;
7280 esac
7281 func_basename_result="${1##*/}"
7282 }
7283
7284 # func_stripname prefix suffix name
7285 # strip PREFIX and SUFFIX off of NAME.
7286 # PREFIX and SUFFIX must not contain globbing or regex special
7287 # characters, hashes, percent signs, but SUFFIX may contain a leading
7288 # dot (in which case that matches only a dot).
7289 func_stripname ()
7290 {
7291 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7292 # positional parameters, so assign one to ordinary parameter first.
7293 func_stripname_result=${3}
7294 func_stripname_result=${func_stripname_result#"${1}"}
7295 func_stripname_result=${func_stripname_result%"${2}"}
7296 }
7297
7298 # func_opt_split
7299 func_opt_split ()
7300 {
7301 func_opt_split_opt=${1%%=*}
7302 func_opt_split_arg=${1#*=}
7303 }
7304
7305 # func_lo2o object
7306 func_lo2o ()
7307 {
7308 case ${1} in
7309 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7310 *) func_lo2o_result=${1} ;;
7311 esac
7312 }
7313
7314 # func_xform libobj-or-source
7315 func_xform ()
7316 {
7317 func_xform_result=${1%.*}.lo
7318 }
7319
7320 # func_arith arithmetic-term...
7321 func_arith ()
7322 {
7323 func_arith_result=$(( $[*] ))
7324 }
7325
7326 # func_len string
7327 # STRING may not start with a hyphen.
7328 func_len ()
7329 {
7330 func_len_result=${#1}
7331 }
7332
7333 _LT_EOF
7676 # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7677 # ------------------------------------------------------
7678 # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7679 # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7680 m4_defun([_LT_PROG_FUNCTION_REPLACE],
7681 [dnl {
7682 sed -e '/^$1 ()$/,/^} # $1 /c\
7683 $1 ()\
7684 {\
7685 m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
7686 } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7687 && mv -f "$cfgfile.tmp" "$cfgfile" \
7688 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7689 test 0 -eq $? || _lt_function_replace_fail=:
7690 ])
7691
7692
7693 # _LT_PROG_REPLACE_SHELLFNS
7694 # -------------------------
7695 # Replace existing portable implementations of several shell functions with
7696 # equivalent extended shell implementations where those features are available..
7697 m4_defun([_LT_PROG_REPLACE_SHELLFNS],
7698 [if test x"$xsi_shell" = xyes; then
7699 _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7700 case ${1} in
7701 */*) func_dirname_result="${1%/*}${2}" ;;
7702 * ) func_dirname_result="${3}" ;;
7703 esac])
7704
7705 _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7706 func_basename_result="${1##*/}"])
7707
7708 _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7709 case ${1} in
7710 */*) func_dirname_result="${1%/*}${2}" ;;
7711 * ) func_dirname_result="${3}" ;;
7712 esac
7713 func_basename_result="${1##*/}"])
7714
7715 _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7716 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7717 # positional parameters, so assign one to ordinary parameter first.
7718 func_stripname_result=${3}
7719 func_stripname_result=${func_stripname_result#"${1}"}
7720 func_stripname_result=${func_stripname_result%"${2}"}])
7721
7722 _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7723 func_split_long_opt_name=${1%%=*}
7724 func_split_long_opt_arg=${1#*=}])
7725
7726 _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7727 func_split_short_opt_arg=${1#??}
7728 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7729
7730 _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7731 case ${1} in
7732 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7733 *) func_lo2o_result=${1} ;;
7734 esac])
7735
7736 _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
7737
7738 _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
7739
7740 _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
7741 fi
7742
7743 if test x"$lt_shell_append" = xyes; then
7744 _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
7745
7746 _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7747 func_quote_for_eval "${2}"
7748 dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7749 eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7750
7751 # Save a `func_append' function call where possible by direct use of '+='
7752 sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7753 && mv -f "$cfgfile.tmp" "$cfgfile" \
7754 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7755 test 0 -eq $? || _lt_function_replace_fail=:
7756 else
7757 # Save a `func_append' function call even when '+=' is not available
7758 sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7759 && mv -f "$cfgfile.tmp" "$cfgfile" \
7760 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7761 test 0 -eq $? || _lt_function_replace_fail=:
7762 fi
7763
7764 if test x"$_lt_function_replace_fail" = x":"; then
7765 AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7766 fi
7767 ])
7768
7769 # _LT_PATH_CONVERSION_FUNCTIONS
7770 # -----------------------------
7771 # Determine which file name conversion functions should be used by
7772 # func_to_host_file (and, implicitly, by func_to_host_path). These are needed
7773 # for certain cross-compile configurations and native mingw.
7774 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
7775 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
7776 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
7777 AC_MSG_CHECKING([how to convert $build file names to $host format])
7778 AC_CACHE_VAL(lt_cv_to_host_file_cmd,
7779 [case $host in
7780 *-*-mingw* )
7781 case $build in
7782 *-*-mingw* ) # actually msys
7783 lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7784 ;;
7785 *-*-cygwin* )
7786 lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7787 ;;
7788 * ) # otherwise, assume *nix
7789 lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7790 ;;
7791 esac
73347792 ;;
7335 *) # Bourne compatible functions.
7336 cat << \_LT_EOF >> "$cfgfile"
7337
7338 # func_dirname file append nondir_replacement
7339 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
7340 # otherwise set result to NONDIR_REPLACEMENT.
7341 func_dirname ()
7342 {
7343 # Extract subdirectory from the argument.
7344 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
7345 if test "X$func_dirname_result" = "X${1}"; then
7346 func_dirname_result="${3}"
7347 else
7348 func_dirname_result="$func_dirname_result${2}"
7349 fi
7350 }
7351
7352 # func_basename file
7353 func_basename ()
7354 {
7355 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
7356 }
7357
7358 dnl func_dirname_and_basename
7359 dnl A portable version of this function is already defined in general.m4sh
7360 dnl so there is no need for it here.
7361
7362 # func_stripname prefix suffix name
7363 # strip PREFIX and SUFFIX off of NAME.
7364 # PREFIX and SUFFIX must not contain globbing or regex special
7365 # characters, hashes, percent signs, but SUFFIX may contain a leading
7366 # dot (in which case that matches only a dot).
7367 # func_strip_suffix prefix name
7368 func_stripname ()
7369 {
7370 case ${2} in
7371 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
7372 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
7373 esac
7374 }
7375
7376 # sed scripts:
7377 my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7378 my_sed_long_arg='1s/^-[[^=]]*=//'
7379
7380 # func_opt_split
7381 func_opt_split ()
7382 {
7383 func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
7384 func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
7385 }
7386
7387 # func_lo2o object
7388 func_lo2o ()
7389 {
7390 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
7391 }
7392
7393 # func_xform libobj-or-source
7394 func_xform ()
7395 {
7396 func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
7397 }
7398
7399 # func_arith arithmetic-term...
7400 func_arith ()
7401 {
7402 func_arith_result=`expr "$[@]"`
7403 }
7404
7405 # func_len string
7406 # STRING may not start with a hyphen.
7407 func_len ()
7408 {
7409 func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7410 }
7411
7412 _LT_EOF
7793 *-*-cygwin* )
7794 case $build in
7795 *-*-mingw* ) # actually msys
7796 lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7797 ;;
7798 *-*-cygwin* )
7799 lt_cv_to_host_file_cmd=func_convert_file_noop
7800 ;;
7801 * ) # otherwise, assume *nix
7802 lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7803 ;;
7804 esac
7805 ;;
7806 * ) # unhandled hosts (and "normal" native builds)
7807 lt_cv_to_host_file_cmd=func_convert_file_noop
7808 ;;
74137809 esac
7414
7415 case $lt_shell_append in
7416 yes)
7417 cat << \_LT_EOF >> "$cfgfile"
7418
7419 # func_append var value
7420 # Append VALUE to the end of shell variable VAR.
7421 func_append ()
7422 {
7423 eval "$[1]+=\$[2]"
7424 }
7425 _LT_EOF
7810 ])
7811 to_host_file_cmd=$lt_cv_to_host_file_cmd
7812 AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
7813 _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
7814 [0], [convert $build file names to $host format])dnl
7815
7816 AC_MSG_CHECKING([how to convert $build file names to toolchain format])
7817 AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
7818 [#assume ordinary cross tools, or native build.
7819 lt_cv_to_tool_file_cmd=func_convert_file_noop
7820 case $host in
7821 *-*-mingw* )
7822 case $build in
7823 *-*-mingw* ) # actually msys
7824 lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7825 ;;
7826 esac
74267827 ;;
7427 *)
7428 cat << \_LT_EOF >> "$cfgfile"
7429
7430 # func_append var value
7431 # Append VALUE to the end of shell variable VAR.
7432 func_append ()
7433 {
7434 eval "$[1]=\$$[1]\$[2]"
7435 }
7436
7437 _LT_EOF
7438 ;;
7439 esac
7828 esac
74407829 ])
7830 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
7831 AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
7832 _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
7833 [0], [convert $build files to toolchain format])dnl
7834 ])# _LT_PATH_CONVERSION_FUNCTIONS
66 # unlimited permission to copy and/or distribute it, with or without
77 # modifications, as long as this notice is preserved.
88
9 # Generated from ltversion.in.
9 # @configure_input@
1010
11 # serial 3175 ltversion.m4
11 # serial 3293 ltversion.m4
1212 # This file is part of GNU Libtool
1313
14 m4_define([LT_PACKAGE_VERSION], [2.2.10])
15 m4_define([LT_PACKAGE_REVISION], [1.3175])
14 m4_define([LT_PACKAGE_VERSION], [2.4])
15 m4_define([LT_PACKAGE_REVISION], [1.3293])
1616
1717 AC_DEFUN([LTVERSION_VERSION],
18 [macro_version='2.2.10'
19 macro_revision='1.3175'
18 [macro_version='2.4'
19 macro_revision='1.3293'
2020 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
2121 _LT_DECL(, macro_revision, 0)
2222 ])
9999 DATADIRNAME = @DATADIRNAME@
100100 DEFS = @DEFS@
101101 DEPDIR = @DEPDIR@
102 DLLTOOL = @DLLTOOL@
102103 DSYMUTIL = @DSYMUTIL@
103104 DUMPBIN = @DUMPBIN@
104105 ECHO_C = @ECHO_C@
110111 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
111112 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
112113 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
114 GLIB2_CFLAGS = @GLIB2_CFLAGS@
115 GLIB2_LIBS = @GLIB2_LIBS@
113116 GMOFILES = @GMOFILES@
114117 GMSGFMT = @GMSGFMT@
115118 GREP = @GREP@
116 GTK2_CFLAGS = @GTK2_CFLAGS@
117 GTK2_LIBS = @GTK2_LIBS@
118 GTKVNC_CFLAGS = @GTKVNC_CFLAGS@
119 GTKVNC_LIBS = @GTKVNC_LIBS@
119 GTK_API_VERSION = @GTK_API_VERSION@
120 GTK_CFLAGS = @GTK_CFLAGS@
121 GTK_LIBS = @GTK_LIBS@
122 GTK_REQUIRED = @GTK_REQUIRED@
123 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
124 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
125 GTK_VNC_LIBS = @GTK_VNC_LIBS@
120126 INSTALL = @INSTALL@
121127 INSTALL_DATA = @INSTALL_DATA@
122128 INSTALL_PROGRAM = @INSTALL_PROGRAM@
130136 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
131137 LD = @LD@
132138 LDFLAGS = @LDFLAGS@
133 LIBGLADE2_CFLAGS = @LIBGLADE2_CFLAGS@
134 LIBGLADE2_LIBS = @LIBGLADE2_LIBS@
135139 LIBOBJS = @LIBOBJS@
136140 LIBS = @LIBS@
137141 LIBTOOL = @LIBTOOL@
143147 LN_S = @LN_S@
144148 LTLIBOBJS = @LTLIBOBJS@
145149 MAKEINFO = @MAKEINFO@
150 MANIFEST_TOOL = @MANIFEST_TOOL@
146151 MKDIR_P = @MKDIR_P@
147152 MKINSTALLDIRS = @MKINSTALLDIRS@
148153 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
177182 SED = @SED@
178183 SET_MAKE = @SET_MAKE@
179184 SHELL = @SHELL@
180 SPICEGTK_CFLAGS = @SPICEGTK_CFLAGS@
181 SPICEGTK_LIBS = @SPICEGTK_LIBS@
185 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
186 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
182187 STRIP = @STRIP@
183188 USE_NLS = @USE_NLS@
184189 VERSION = @VERSION@
188193 abs_srcdir = @abs_srcdir@
189194 abs_top_builddir = @abs_top_builddir@
190195 abs_top_srcdir = @abs_top_srcdir@
196 ac_ct_AR = @ac_ct_AR@
191197 ac_ct_CC = @ac_ct_CC@
192198 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
193199 am__include = @am__include@
5656 Do not attempt to tunnel the console over SSH, even if the main connection URI
5757 used SSH.
5858
59 =item -f, --fullscreen
60
61 Start with the window maximised to fullscreen
62
5963 =item --debug
6064
6165 Print debugging information
1515 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
1616
1717 BuildRequires: mingw32-filesystem >= 23
18 BuildRequires: mingw32-gtk2
18 BuildRequires: mingw32-gtk2 >= 2.12.0
1919 BuildRequires: mingw32-libvirt >= 0.6.0
2020 BuildRequires: mingw32-libxml2
21 BuildRequires: mingw32-libglade2
2221 BuildRequires: mingw32-gtk-vnc >= 0.3.8
2322 BuildRequires: pkgconfig
2423
5554
5655 %dir %{_mingw32_datadir}/virt-viewer/
5756 %dir %{_mingw32_datadir}/virt-viewer/ui/
58 %{_mingw32_datadir}/virt-viewer/ui/about.glade
59 %{_mingw32_datadir}/virt-viewer/ui/auth.glade
60 %{_mingw32_datadir}/virt-viewer/ui/viewer.glade
57 %{_mingw32_datadir}/virt-viewer/ui/virt-viewer.xml
58 %{_mingw32_datadir}/virt-viewer/ui/virt-viewer-about.xml
59 %{_mingw32_datadir}/virt-viewer/ui/virt-viewer-auth.xml
6160
6261 %{_mingw32_mandir}/man1/virt-viewer.1*
6362
33 plugin_LTLIBRARIES = virt-viewer-plugin.la
44
55 virt_viewer_plugin_la_SOURCES = \
6 ../src/util.c ../src/util.h \
7 ../src/auth.c ../src/auth.h \
8 ../src/viewer.c ../src/viewer.h \
9 ../src/events.c ../src/events.h \
6 ../src/virt-viewer-util.c ../src/virt-viewer-util.h \
7 ../src/virt-viewer-auth.c ../src/virt-viewer-auth.h \
8 ../src/virt-viewer.c ../src/virt-viewer.h \
9 ../src/virt-viewer-events.c ../src/virt-viewer-events.h \
1010 virt-viewer-plugin.c virt-viewer-plugin.h \
1111 npshell.c npunix.c
1212 virt_viewer_plugin_la_LIBADD = \
7070 am__installdirs = "$(DESTDIR)$(plugindir)"
7171 LTLIBRARIES = $(plugin_LTLIBRARIES)
7272 virt_viewer_plugin_la_DEPENDENCIES =
73 am__virt_viewer_plugin_la_SOURCES_DIST = ../src/util.c ../src/util.h \
74 ../src/auth.c ../src/auth.h ../src/viewer.c ../src/viewer.h \
75 ../src/events.c ../src/events.h virt-viewer-plugin.c \
73 am__virt_viewer_plugin_la_SOURCES_DIST = ../src/virt-viewer-util.c \
74 ../src/virt-viewer-util.h ../src/virt-viewer-auth.c \
75 ../src/virt-viewer-auth.h ../src/virt-viewer.c \
76 ../src/virt-viewer.h ../src/virt-viewer-events.c \
77 ../src/virt-viewer-events.h virt-viewer-plugin.c \
7678 virt-viewer-plugin.h npshell.c npunix.c
7779 @ENABLE_PLUGIN_TRUE@am_virt_viewer_plugin_la_OBJECTS = \
78 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-util.lo \
79 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-auth.lo \
80 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-viewer.lo \
81 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-events.lo \
80 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-virt-viewer-util.lo \
81 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-virt-viewer-auth.lo \
82 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-virt-viewer.lo \
83 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-virt-viewer-events.lo \
8284 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-virt-viewer-plugin.lo \
8385 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-npshell.lo \
8486 @ENABLE_PLUGIN_TRUE@ virt_viewer_plugin_la-npunix.lo
143145 DATADIRNAME = @DATADIRNAME@
144146 DEFS = @DEFS@
145147 DEPDIR = @DEPDIR@
148 DLLTOOL = @DLLTOOL@
146149 DSYMUTIL = @DSYMUTIL@
147150 DUMPBIN = @DUMPBIN@
148151 ECHO_C = @ECHO_C@
154157 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
155158 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
156159 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
160 GLIB2_CFLAGS = @GLIB2_CFLAGS@
161 GLIB2_LIBS = @GLIB2_LIBS@
157162 GMOFILES = @GMOFILES@
158163 GMSGFMT = @GMSGFMT@
159164 GREP = @GREP@
160 GTK2_CFLAGS = @GTK2_CFLAGS@
161 GTK2_LIBS = @GTK2_LIBS@
162 GTKVNC_CFLAGS = @GTKVNC_CFLAGS@
163 GTKVNC_LIBS = @GTKVNC_LIBS@
165 GTK_API_VERSION = @GTK_API_VERSION@
166 GTK_CFLAGS = @GTK_CFLAGS@
167 GTK_LIBS = @GTK_LIBS@
168 GTK_REQUIRED = @GTK_REQUIRED@
169 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
170 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
171 GTK_VNC_LIBS = @GTK_VNC_LIBS@
164172 INSTALL = @INSTALL@
165173 INSTALL_DATA = @INSTALL_DATA@
166174 INSTALL_PROGRAM = @INSTALL_PROGRAM@
174182 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
175183 LD = @LD@
176184 LDFLAGS = @LDFLAGS@
177 LIBGLADE2_CFLAGS = @LIBGLADE2_CFLAGS@
178 LIBGLADE2_LIBS = @LIBGLADE2_LIBS@
179185 LIBOBJS = @LIBOBJS@
180186 LIBS = @LIBS@
181187 LIBTOOL = @LIBTOOL@
187193 LN_S = @LN_S@
188194 LTLIBOBJS = @LTLIBOBJS@
189195 MAKEINFO = @MAKEINFO@
196 MANIFEST_TOOL = @MANIFEST_TOOL@
190197 MKDIR_P = @MKDIR_P@
191198 MKINSTALLDIRS = @MKINSTALLDIRS@
192199 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
221228 SED = @SED@
222229 SET_MAKE = @SET_MAKE@
223230 SHELL = @SHELL@
224 SPICEGTK_CFLAGS = @SPICEGTK_CFLAGS@
225 SPICEGTK_LIBS = @SPICEGTK_LIBS@
231 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
232 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
226233 STRIP = @STRIP@
227234 USE_NLS = @USE_NLS@
228235 VERSION = @VERSION@
232239 abs_srcdir = @abs_srcdir@
233240 abs_top_builddir = @abs_top_builddir@
234241 abs_top_srcdir = @abs_top_srcdir@
242 ac_ct_AR = @ac_ct_AR@
235243 ac_ct_CC = @ac_ct_CC@
236244 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
237245 am__include = @am__include@
282290 @ENABLE_PLUGIN_TRUE@plugindir = $(libdir)/mozilla/plugins
283291 @ENABLE_PLUGIN_TRUE@plugin_LTLIBRARIES = virt-viewer-plugin.la
284292 @ENABLE_PLUGIN_TRUE@virt_viewer_plugin_la_SOURCES = \
285 @ENABLE_PLUGIN_TRUE@ ../src/util.c ../src/util.h \
286 @ENABLE_PLUGIN_TRUE@ ../src/auth.c ../src/auth.h \
287 @ENABLE_PLUGIN_TRUE@ ../src/viewer.c ../src/viewer.h \
288 @ENABLE_PLUGIN_TRUE@ ../src/events.c ../src/events.h \
293 @ENABLE_PLUGIN_TRUE@ ../src/virt-viewer-util.c ../src/virt-viewer-util.h \
294 @ENABLE_PLUGIN_TRUE@ ../src/virt-viewer-auth.c ../src/virt-viewer-auth.h \
295 @ENABLE_PLUGIN_TRUE@ ../src/virt-viewer.c ../src/virt-viewer.h \
296 @ENABLE_PLUGIN_TRUE@ ../src/virt-viewer-events.c ../src/virt-viewer-events.h \
289297 @ENABLE_PLUGIN_TRUE@ virt-viewer-plugin.c virt-viewer-plugin.h \
290298 @ENABLE_PLUGIN_TRUE@ npshell.c npunix.c
291299
386394 distclean-compile:
387395 -rm -f *.tab.c
388396
389 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-auth.Plo@am__quote@
390 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-events.Plo@am__quote@
391397 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-npshell.Plo@am__quote@
392398 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-npunix.Plo@am__quote@
393 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-util.Plo@am__quote@
394 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-viewer.Plo@am__quote@
399 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-virt-viewer-auth.Plo@am__quote@
400 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-virt-viewer-events.Plo@am__quote@
395401 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-virt-viewer-plugin.Plo@am__quote@
402 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-virt-viewer-util.Plo@am__quote@
403 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer_plugin_la-virt-viewer.Plo@am__quote@
396404
397405 .c.o:
398406 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
418426 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
419427 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
420428
421 virt_viewer_plugin_la-util.lo: ../src/util.c
422 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -MT virt_viewer_plugin_la-util.lo -MD -MP -MF $(DEPDIR)/virt_viewer_plugin_la-util.Tpo -c -o virt_viewer_plugin_la-util.lo `test -f '../src/util.c' || echo '$(srcdir)/'`../src/util.c
423 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer_plugin_la-util.Tpo $(DEPDIR)/virt_viewer_plugin_la-util.Plo
424 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
425 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/util.c' object='virt_viewer_plugin_la-util.lo' libtool=yes @AMDEPBACKSLASH@
426 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
427 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -c -o virt_viewer_plugin_la-util.lo `test -f '../src/util.c' || echo '$(srcdir)/'`../src/util.c
428
429 virt_viewer_plugin_la-auth.lo: ../src/auth.c
430 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -MT virt_viewer_plugin_la-auth.lo -MD -MP -MF $(DEPDIR)/virt_viewer_plugin_la-auth.Tpo -c -o virt_viewer_plugin_la-auth.lo `test -f '../src/auth.c' || echo '$(srcdir)/'`../src/auth.c
431 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer_plugin_la-auth.Tpo $(DEPDIR)/virt_viewer_plugin_la-auth.Plo
432 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
433 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/auth.c' object='virt_viewer_plugin_la-auth.lo' libtool=yes @AMDEPBACKSLASH@
434 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
435 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -c -o virt_viewer_plugin_la-auth.lo `test -f '../src/auth.c' || echo '$(srcdir)/'`../src/auth.c
436
437 virt_viewer_plugin_la-viewer.lo: ../src/viewer.c
438 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -MT virt_viewer_plugin_la-viewer.lo -MD -MP -MF $(DEPDIR)/virt_viewer_plugin_la-viewer.Tpo -c -o virt_viewer_plugin_la-viewer.lo `test -f '../src/viewer.c' || echo '$(srcdir)/'`../src/viewer.c
439 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer_plugin_la-viewer.Tpo $(DEPDIR)/virt_viewer_plugin_la-viewer.Plo
440 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
441 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/viewer.c' object='virt_viewer_plugin_la-viewer.lo' libtool=yes @AMDEPBACKSLASH@
442 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
443 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -c -o virt_viewer_plugin_la-viewer.lo `test -f '../src/viewer.c' || echo '$(srcdir)/'`../src/viewer.c
444
445 virt_viewer_plugin_la-events.lo: ../src/events.c
446 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -MT virt_viewer_plugin_la-events.lo -MD -MP -MF $(DEPDIR)/virt_viewer_plugin_la-events.Tpo -c -o virt_viewer_plugin_la-events.lo `test -f '../src/events.c' || echo '$(srcdir)/'`../src/events.c
447 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer_plugin_la-events.Tpo $(DEPDIR)/virt_viewer_plugin_la-events.Plo
448 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
449 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/events.c' object='virt_viewer_plugin_la-events.lo' libtool=yes @AMDEPBACKSLASH@
450 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
451 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -c -o virt_viewer_plugin_la-events.lo `test -f '../src/events.c' || echo '$(srcdir)/'`../src/events.c
429 virt_viewer_plugin_la-virt-viewer-util.lo: ../src/virt-viewer-util.c
430 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -MT virt_viewer_plugin_la-virt-viewer-util.lo -MD -MP -MF $(DEPDIR)/virt_viewer_plugin_la-virt-viewer-util.Tpo -c -o virt_viewer_plugin_la-virt-viewer-util.lo `test -f '../src/virt-viewer-util.c' || echo '$(srcdir)/'`../src/virt-viewer-util.c
431 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer_plugin_la-virt-viewer-util.Tpo $(DEPDIR)/virt_viewer_plugin_la-virt-viewer-util.Plo
432 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
433 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/virt-viewer-util.c' object='virt_viewer_plugin_la-virt-viewer-util.lo' libtool=yes @AMDEPBACKSLASH@
434 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
435 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -c -o virt_viewer_plugin_la-virt-viewer-util.lo `test -f '../src/virt-viewer-util.c' || echo '$(srcdir)/'`../src/virt-viewer-util.c
436
437 virt_viewer_plugin_la-virt-viewer-auth.lo: ../src/virt-viewer-auth.c
438 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -MT virt_viewer_plugin_la-virt-viewer-auth.lo -MD -MP -MF $(DEPDIR)/virt_viewer_plugin_la-virt-viewer-auth.Tpo -c -o virt_viewer_plugin_la-virt-viewer-auth.lo `test -f '../src/virt-viewer-auth.c' || echo '$(srcdir)/'`../src/virt-viewer-auth.c
439 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer_plugin_la-virt-viewer-auth.Tpo $(DEPDIR)/virt_viewer_plugin_la-virt-viewer-auth.Plo
440 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
441 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/virt-viewer-auth.c' object='virt_viewer_plugin_la-virt-viewer-auth.lo' libtool=yes @AMDEPBACKSLASH@
442 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
443 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -c -o virt_viewer_plugin_la-virt-viewer-auth.lo `test -f '../src/virt-viewer-auth.c' || echo '$(srcdir)/'`../src/virt-viewer-auth.c
444
445 virt_viewer_plugin_la-virt-viewer.lo: ../src/virt-viewer.c
446 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -MT virt_viewer_plugin_la-virt-viewer.lo -MD -MP -MF $(DEPDIR)/virt_viewer_plugin_la-virt-viewer.Tpo -c -o virt_viewer_plugin_la-virt-viewer.lo `test -f '../src/virt-viewer.c' || echo '$(srcdir)/'`../src/virt-viewer.c
447 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer_plugin_la-virt-viewer.Tpo $(DEPDIR)/virt_viewer_plugin_la-virt-viewer.Plo
448 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
449 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/virt-viewer.c' object='virt_viewer_plugin_la-virt-viewer.lo' libtool=yes @AMDEPBACKSLASH@
450 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
451 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -c -o virt_viewer_plugin_la-virt-viewer.lo `test -f '../src/virt-viewer.c' || echo '$(srcdir)/'`../src/virt-viewer.c
452
453 virt_viewer_plugin_la-virt-viewer-events.lo: ../src/virt-viewer-events.c
454 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -MT virt_viewer_plugin_la-virt-viewer-events.lo -MD -MP -MF $(DEPDIR)/virt_viewer_plugin_la-virt-viewer-events.Tpo -c -o virt_viewer_plugin_la-virt-viewer-events.lo `test -f '../src/virt-viewer-events.c' || echo '$(srcdir)/'`../src/virt-viewer-events.c
455 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer_plugin_la-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer_plugin_la-virt-viewer-events.Plo
456 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
457 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/virt-viewer-events.c' object='virt_viewer_plugin_la-virt-viewer-events.lo' libtool=yes @AMDEPBACKSLASH@
458 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
459 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -c -o virt_viewer_plugin_la-virt-viewer-events.lo `test -f '../src/virt-viewer-events.c' || echo '$(srcdir)/'`../src/virt-viewer-events.c
452460
453461 virt_viewer_plugin_la-virt-viewer-plugin.lo: virt-viewer-plugin.c
454462 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_plugin_la_CFLAGS) $(CFLAGS) -MT virt_viewer_plugin_la-virt-viewer-plugin.lo -MD -MP -MF $(DEPDIR)/virt_viewer_plugin_la-virt-viewer-plugin.Tpo -c -o virt_viewer_plugin_la-virt-viewer-plugin.lo `test -f 'virt-viewer-plugin.c' || echo '$(srcdir)/'`virt-viewer-plugin.c
00
11 bin_PROGRAMS = virt-viewer
22
3 gladedir = $(pkgdatadir)/ui
4 glade_DATA = viewer.glade about.glade auth.glade
3 builderxmldir = $(pkgdatadir)/ui
4 builderxml_DATA = \
5 virt-viewer.xml \
6 virt-viewer-about.xml \
7 virt-viewer-auth.xml
58
6 EXTRA_DIST = $(glade_DATA)
9 EXTRA_DIST = $(builderxml_DATA)
710
811 virt_viewer_SOURCES = \
9 main.c \
10 util.h util.c \
11 auth.h auth.c \
12 events.h events.c \
13 viewer.h viewer.c \
14 viewer-priv.h \
15 display.h display.c \
16 display-vnc.h display-vnc.c
12 virt-viewer-main.c \
13 virt-viewer-util.h virt-viewer-util.c \
14 virt-viewer-auth.h virt-viewer-auth.c \
15 virt-viewer-events.h virt-viewer-events.c \
16 virt-viewer.h virt-viewer.c \
17 virt-viewer-session.h virt-viewer-session.c \
18 virt-viewer-session-vnc.h virt-viewer-session-vnc.c \
19 virt-viewer-display.h virt-viewer-display.c \
20 virt-viewer-display-vnc.h virt-viewer-display-vnc.c \
21 view/autoDrawer.c \
22 view/autoDrawer.h \
23 view/drawer.c \
24 view/drawer.h \
25 view/ovBox.c \
26 view/ovBox.h
27
1728
1829 if HAVE_SPICE_GTK
1930 virt_viewer_SOURCES += \
20 display-spice.h display-spice.c
31 virt-viewer-session-spice.h virt-viewer-session-spice.c \
32 virt-viewer-display-spice.h virt-viewer-display-spice.c
2133 endif
2234
2335 virt_viewer_LDADD = \
24 @GTKVNC_LIBS@ \
25 @SPICEGTK_LIBS@ \
26 @GTK2_LIBS@ \
36 @GTK_VNC_LIBS@ \
37 @SPICE_GTK_LIBS@ \
38 @GLIB2_LIBS@ \
39 @GTK_LIBS@ \
2740 @LIBXML2_LIBS@ \
28 @LIBGLADE2_LIBS@ \
2941 @LIBVIRT_LIBS@
3042
3143 virt_viewer_CFLAGS = \
32 @GTKVNC_CFLAGS@ \
33 @SPICEGTK_CFLAGS@ \
34 @GTK2_CFLAGS@ \
44 @GTK_VNC_CFLAGS@ \
45 @SPICE_GTK_CFLAGS@ \
46 @GLIB2_CFLAGS@ \
47 @GTK_CFLAGS@ \
3548 @LIBXML2_CFLAGS@ \
36 @LIBGLADE2_CFLAGS@ \
3749 @LIBVIRT_CFLAGS@ \
3850 @WARN_CFLAGS@ \
39 -DGLADE_DIR="\"$(gladedir)\"" \
51 -DBUILDER_XML_DIR="\"$(builderxmldir)\"" \
4052 -DLOCALE_DIR=\""$(datadir)/locale"\"
3636 host_triplet = @host@
3737 bin_PROGRAMS = virt-viewer$(EXEEXT)
3838 @HAVE_SPICE_GTK_TRUE@am__append_1 = \
39 @HAVE_SPICE_GTK_TRUE@ display-spice.h display-spice.c
39 @HAVE_SPICE_GTK_TRUE@ virt-viewer-session-spice.h virt-viewer-session-spice.c \
40 @HAVE_SPICE_GTK_TRUE@ virt-viewer-display-spice.h virt-viewer-display-spice.c
4041
4142 subdir = src
4243 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
5152 CONFIG_HEADER = $(top_builddir)/config.h
5253 CONFIG_CLEAN_FILES =
5354 CONFIG_CLEAN_VPATH_FILES =
54 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gladedir)"
55 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(builderxmldir)"
5556 PROGRAMS = $(bin_PROGRAMS)
56 am__virt_viewer_SOURCES_DIST = main.c util.h util.c auth.h auth.c \
57 events.h events.c viewer.h viewer.c viewer-priv.h display.h \
58 display.c display-vnc.h display-vnc.c display-spice.h \
59 display-spice.c
60 @HAVE_SPICE_GTK_TRUE@am__objects_1 = \
61 @HAVE_SPICE_GTK_TRUE@ virt_viewer-display-spice.$(OBJEXT)
62 am_virt_viewer_OBJECTS = virt_viewer-main.$(OBJEXT) \
63 virt_viewer-util.$(OBJEXT) virt_viewer-auth.$(OBJEXT) \
64 virt_viewer-events.$(OBJEXT) virt_viewer-viewer.$(OBJEXT) \
65 virt_viewer-display.$(OBJEXT) \
66 virt_viewer-display-vnc.$(OBJEXT) $(am__objects_1)
57 am__virt_viewer_SOURCES_DIST = virt-viewer-main.c virt-viewer-util.h \
58 virt-viewer-util.c virt-viewer-auth.h virt-viewer-auth.c \
59 virt-viewer-events.h virt-viewer-events.c virt-viewer.h \
60 virt-viewer.c virt-viewer-session.h virt-viewer-session.c \
61 virt-viewer-session-vnc.h virt-viewer-session-vnc.c \
62 virt-viewer-display.h virt-viewer-display.c \
63 virt-viewer-display-vnc.h virt-viewer-display-vnc.c \
64 view/autoDrawer.c view/autoDrawer.h view/drawer.c \
65 view/drawer.h view/ovBox.c view/ovBox.h \
66 virt-viewer-session-spice.h virt-viewer-session-spice.c \
67 virt-viewer-display-spice.h virt-viewer-display-spice.c
68 @HAVE_SPICE_GTK_TRUE@am__objects_1 = virt_viewer-virt-viewer-session-spice.$(OBJEXT) \
69 @HAVE_SPICE_GTK_TRUE@ virt_viewer-virt-viewer-display-spice.$(OBJEXT)
70 am_virt_viewer_OBJECTS = virt_viewer-virt-viewer-main.$(OBJEXT) \
71 virt_viewer-virt-viewer-util.$(OBJEXT) \
72 virt_viewer-virt-viewer-auth.$(OBJEXT) \
73 virt_viewer-virt-viewer-events.$(OBJEXT) \
74 virt_viewer-virt-viewer.$(OBJEXT) \
75 virt_viewer-virt-viewer-session.$(OBJEXT) \
76 virt_viewer-virt-viewer-session-vnc.$(OBJEXT) \
77 virt_viewer-virt-viewer-display.$(OBJEXT) \
78 virt_viewer-virt-viewer-display-vnc.$(OBJEXT) \
79 virt_viewer-autoDrawer.$(OBJEXT) virt_viewer-drawer.$(OBJEXT) \
80 virt_viewer-ovBox.$(OBJEXT) $(am__objects_1)
6781 virt_viewer_OBJECTS = $(am_virt_viewer_OBJECTS)
6882 virt_viewer_DEPENDENCIES =
6983 AM_V_lt = $(am__v_lt_$(V))
121135 am__base_list = \
122136 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
123137 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
124 DATA = $(glade_DATA)
138 DATA = $(builderxml_DATA)
125139 ETAGS = etags
126140 CTAGS = ctags
127141 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
145159 DATADIRNAME = @DATADIRNAME@
146160 DEFS = @DEFS@
147161 DEPDIR = @DEPDIR@
162 DLLTOOL = @DLLTOOL@
148163 DSYMUTIL = @DSYMUTIL@
149164 DUMPBIN = @DUMPBIN@
150165 ECHO_C = @ECHO_C@
156171 FIREFOX_PLUGIN_CFLAGS = @FIREFOX_PLUGIN_CFLAGS@
157172 FIREFOX_PLUGIN_LIBS = @FIREFOX_PLUGIN_LIBS@
158173 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
174 GLIB2_CFLAGS = @GLIB2_CFLAGS@
175 GLIB2_LIBS = @GLIB2_LIBS@
159176 GMOFILES = @GMOFILES@
160177 GMSGFMT = @GMSGFMT@
161178 GREP = @GREP@
162 GTK2_CFLAGS = @GTK2_CFLAGS@
163 GTK2_LIBS = @GTK2_LIBS@
164 GTKVNC_CFLAGS = @GTKVNC_CFLAGS@
165 GTKVNC_LIBS = @GTKVNC_LIBS@
179 GTK_API_VERSION = @GTK_API_VERSION@
180 GTK_CFLAGS = @GTK_CFLAGS@
181 GTK_LIBS = @GTK_LIBS@
182 GTK_REQUIRED = @GTK_REQUIRED@
183 GTK_VNC_API_VERSION = @GTK_VNC_API_VERSION@
184 GTK_VNC_CFLAGS = @GTK_VNC_CFLAGS@
185 GTK_VNC_LIBS = @GTK_VNC_LIBS@
166186 INSTALL = @INSTALL@
167187 INSTALL_DATA = @INSTALL_DATA@
168188 INSTALL_PROGRAM = @INSTALL_PROGRAM@
176196 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
177197 LD = @LD@
178198 LDFLAGS = @LDFLAGS@
179 LIBGLADE2_CFLAGS = @LIBGLADE2_CFLAGS@
180 LIBGLADE2_LIBS = @LIBGLADE2_LIBS@
181199 LIBOBJS = @LIBOBJS@
182200 LIBS = @LIBS@
183201 LIBTOOL = @LIBTOOL@
189207 LN_S = @LN_S@
190208 LTLIBOBJS = @LTLIBOBJS@
191209 MAKEINFO = @MAKEINFO@
210 MANIFEST_TOOL = @MANIFEST_TOOL@
192211 MKDIR_P = @MKDIR_P@
193212 MKINSTALLDIRS = @MKINSTALLDIRS@
194213 MOZILLA_PLUGIN_CFLAGS = @MOZILLA_PLUGIN_CFLAGS@
223242 SED = @SED@
224243 SET_MAKE = @SET_MAKE@
225244 SHELL = @SHELL@
226 SPICEGTK_CFLAGS = @SPICEGTK_CFLAGS@
227 SPICEGTK_LIBS = @SPICEGTK_LIBS@
245 SPICE_GTK_CFLAGS = @SPICE_GTK_CFLAGS@
246 SPICE_GTK_LIBS = @SPICE_GTK_LIBS@
228247 STRIP = @STRIP@
229248 USE_NLS = @USE_NLS@
230249 VERSION = @VERSION@
234253 abs_srcdir = @abs_srcdir@
235254 abs_top_builddir = @abs_top_builddir@
236255 abs_top_srcdir = @abs_top_srcdir@
256 ac_ct_AR = @ac_ct_AR@
237257 ac_ct_CC = @ac_ct_CC@
238258 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
239259 am__include = @am__include@
281301 top_build_prefix = @top_build_prefix@
282302 top_builddir = @top_builddir@
283303 top_srcdir = @top_srcdir@
284 gladedir = $(pkgdatadir)/ui
285 glade_DATA = viewer.glade about.glade auth.glade
286 EXTRA_DIST = $(glade_DATA)
287 virt_viewer_SOURCES = main.c util.h util.c auth.h auth.c events.h \
288 events.c viewer.h viewer.c viewer-priv.h display.h display.c \
289 display-vnc.h display-vnc.c $(am__append_1)
304 builderxmldir = $(pkgdatadir)/ui
305 builderxml_DATA = \
306 virt-viewer.xml \
307 virt-viewer-about.xml \
308 virt-viewer-auth.xml
309
310 EXTRA_DIST = $(builderxml_DATA)
311 virt_viewer_SOURCES = virt-viewer-main.c virt-viewer-util.h \
312 virt-viewer-util.c virt-viewer-auth.h virt-viewer-auth.c \
313 virt-viewer-events.h virt-viewer-events.c virt-viewer.h \
314 virt-viewer.c virt-viewer-session.h virt-viewer-session.c \
315 virt-viewer-session-vnc.h virt-viewer-session-vnc.c \
316 virt-viewer-display.h virt-viewer-display.c \
317 virt-viewer-display-vnc.h virt-viewer-display-vnc.c \
318 view/autoDrawer.c view/autoDrawer.h view/drawer.c \
319 view/drawer.h view/ovBox.c view/ovBox.h $(am__append_1)
290320 virt_viewer_LDADD = \
291 @GTKVNC_LIBS@ \
292 @SPICEGTK_LIBS@ \
293 @GTK2_LIBS@ \
321 @GTK_VNC_LIBS@ \
322 @SPICE_GTK_LIBS@ \
323 @GLIB2_LIBS@ \
324 @GTK_LIBS@ \
294325 @LIBXML2_LIBS@ \
295 @LIBGLADE2_LIBS@ \
296326 @LIBVIRT_LIBS@
297327
298328 virt_viewer_CFLAGS = \
299 @GTKVNC_CFLAGS@ \
300 @SPICEGTK_CFLAGS@ \
301 @GTK2_CFLAGS@ \
329 @GTK_VNC_CFLAGS@ \
330 @SPICE_GTK_CFLAGS@ \
331 @GLIB2_CFLAGS@ \
332 @GTK_CFLAGS@ \
302333 @LIBXML2_CFLAGS@ \
303 @LIBGLADE2_CFLAGS@ \
304334 @LIBVIRT_CFLAGS@ \
305335 @WARN_CFLAGS@ \
306 -DGLADE_DIR="\"$(gladedir)\"" \
336 -DBUILDER_XML_DIR="\"$(builderxmldir)\"" \
307337 -DLOCALE_DIR=\""$(datadir)/locale"\"
308338
309339 all: all-am
393423 distclean-compile:
394424 -rm -f *.tab.c
395425
396 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-auth.Po@am__quote@
397 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-display-spice.Po@am__quote@
398 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-display-vnc.Po@am__quote@
399 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-display.Po@am__quote@
400 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-events.Po@am__quote@
401 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-main.Po@am__quote@
402 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-util.Po@am__quote@
403 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-viewer.Po@am__quote@
426 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-autoDrawer.Po@am__quote@
427 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-drawer.Po@am__quote@
428 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-ovBox.Po@am__quote@
429 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-auth.Po@am__quote@
430 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-display-spice.Po@am__quote@
431 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Po@am__quote@
432 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-display.Po@am__quote@
433 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-events.Po@am__quote@
434 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-main.Po@am__quote@
435 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-session-spice.Po@am__quote@
436 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Po@am__quote@
437 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-session.Po@am__quote@
438 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer-util.Po@am__quote@
439 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_viewer-virt-viewer.Po@am__quote@
404440
405441 .c.o:
406442 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
426462 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
427463 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
428464
429 virt_viewer-main.o: main.c
430 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-main.o -MD -MP -MF $(DEPDIR)/virt_viewer-main.Tpo -c -o virt_viewer-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
431 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-main.Tpo $(DEPDIR)/virt_viewer-main.Po
432 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
433 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='virt_viewer-main.o' libtool=no @AMDEPBACKSLASH@
434 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
435 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
436
437 virt_viewer-main.obj: main.c
438 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-main.obj -MD -MP -MF $(DEPDIR)/virt_viewer-main.Tpo -c -o virt_viewer-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
439 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-main.Tpo $(DEPDIR)/virt_viewer-main.Po
440 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
441 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='virt_viewer-main.obj' libtool=no @AMDEPBACKSLASH@
442 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
443 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
444
445 virt_viewer-util.o: util.c
446 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-util.o -MD -MP -MF $(DEPDIR)/virt_viewer-util.Tpo -c -o virt_viewer-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
447 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-util.Tpo $(DEPDIR)/virt_viewer-util.Po
448 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
449 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='virt_viewer-util.o' libtool=no @AMDEPBACKSLASH@
450 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
451 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
452
453 virt_viewer-util.obj: util.c
454 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-util.obj -MD -MP -MF $(DEPDIR)/virt_viewer-util.Tpo -c -o virt_viewer-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
455 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-util.Tpo $(DEPDIR)/virt_viewer-util.Po
456 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
457 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='virt_viewer-util.obj' libtool=no @AMDEPBACKSLASH@
458 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
459 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
460
461 virt_viewer-auth.o: auth.c
462 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-auth.o -MD -MP -MF $(DEPDIR)/virt_viewer-auth.Tpo -c -o virt_viewer-auth.o `test -f 'auth.c' || echo '$(srcdir)/'`auth.c
463 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-auth.Tpo $(DEPDIR)/virt_viewer-auth.Po
464 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
465 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='auth.c' object='virt_viewer-auth.o' libtool=no @AMDEPBACKSLASH@
466 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
467 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-auth.o `test -f 'auth.c' || echo '$(srcdir)/'`auth.c
468
469 virt_viewer-auth.obj: auth.c
470 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-auth.obj -MD -MP -MF $(DEPDIR)/virt_viewer-auth.Tpo -c -o virt_viewer-auth.obj `if test -f 'auth.c'; then $(CYGPATH_W) 'auth.c'; else $(CYGPATH_W) '$(srcdir)/auth.c'; fi`
471 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-auth.Tpo $(DEPDIR)/virt_viewer-auth.Po
472 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
473 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='auth.c' object='virt_viewer-auth.obj' libtool=no @AMDEPBACKSLASH@
474 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
475 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-auth.obj `if test -f 'auth.c'; then $(CYGPATH_W) 'auth.c'; else $(CYGPATH_W) '$(srcdir)/auth.c'; fi`
476
477 virt_viewer-events.o: events.c
478 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-events.o -MD -MP -MF $(DEPDIR)/virt_viewer-events.Tpo -c -o virt_viewer-events.o `test -f 'events.c' || echo '$(srcdir)/'`events.c
479 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-events.Tpo $(DEPDIR)/virt_viewer-events.Po
480 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
481 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='events.c' object='virt_viewer-events.o' libtool=no @AMDEPBACKSLASH@
482 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
483 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-events.o `test -f 'events.c' || echo '$(srcdir)/'`events.c
484
485 virt_viewer-events.obj: events.c
486 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-events.obj -MD -MP -MF $(DEPDIR)/virt_viewer-events.Tpo -c -o virt_viewer-events.obj `if test -f 'events.c'; then $(CYGPATH_W) 'events.c'; else $(CYGPATH_W) '$(srcdir)/events.c'; fi`
487 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-events.Tpo $(DEPDIR)/virt_viewer-events.Po
488 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
489 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='events.c' object='virt_viewer-events.obj' libtool=no @AMDEPBACKSLASH@
490 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
491 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-events.obj `if test -f 'events.c'; then $(CYGPATH_W) 'events.c'; else $(CYGPATH_W) '$(srcdir)/events.c'; fi`
492
493 virt_viewer-viewer.o: viewer.c
494 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-viewer.o -MD -MP -MF $(DEPDIR)/virt_viewer-viewer.Tpo -c -o virt_viewer-viewer.o `test -f 'viewer.c' || echo '$(srcdir)/'`viewer.c
495 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-viewer.Tpo $(DEPDIR)/virt_viewer-viewer.Po
496 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
497 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='viewer.c' object='virt_viewer-viewer.o' libtool=no @AMDEPBACKSLASH@
498 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
499 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-viewer.o `test -f 'viewer.c' || echo '$(srcdir)/'`viewer.c
500
501 virt_viewer-viewer.obj: viewer.c
502 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-viewer.obj -MD -MP -MF $(DEPDIR)/virt_viewer-viewer.Tpo -c -o virt_viewer-viewer.obj `if test -f 'viewer.c'; then $(CYGPATH_W) 'viewer.c'; else $(CYGPATH_W) '$(srcdir)/viewer.c'; fi`
503 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-viewer.Tpo $(DEPDIR)/virt_viewer-viewer.Po
504 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
505 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='viewer.c' object='virt_viewer-viewer.obj' libtool=no @AMDEPBACKSLASH@
506 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
507 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-viewer.obj `if test -f 'viewer.c'; then $(CYGPATH_W) 'viewer.c'; else $(CYGPATH_W) '$(srcdir)/viewer.c'; fi`
508
509 virt_viewer-display.o: display.c
510 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-display.o -MD -MP -MF $(DEPDIR)/virt_viewer-display.Tpo -c -o virt_viewer-display.o `test -f 'display.c' || echo '$(srcdir)/'`display.c
511 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-display.Tpo $(DEPDIR)/virt_viewer-display.Po
512 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
513 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='display.c' object='virt_viewer-display.o' libtool=no @AMDEPBACKSLASH@
514 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
515 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-display.o `test -f 'display.c' || echo '$(srcdir)/'`display.c
516
517 virt_viewer-display.obj: display.c
518 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-display.obj -MD -MP -MF $(DEPDIR)/virt_viewer-display.Tpo -c -o virt_viewer-display.obj `if test -f 'display.c'; then $(CYGPATH_W) 'display.c'; else $(CYGPATH_W) '$(srcdir)/display.c'; fi`
519 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-display.Tpo $(DEPDIR)/virt_viewer-display.Po
520 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
521 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='display.c' object='virt_viewer-display.obj' libtool=no @AMDEPBACKSLASH@
522 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
523 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-display.obj `if test -f 'display.c'; then $(CYGPATH_W) 'display.c'; else $(CYGPATH_W) '$(srcdir)/display.c'; fi`
524
525 virt_viewer-display-vnc.o: display-vnc.c
526 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-display-vnc.o -MD -MP -MF $(DEPDIR)/virt_viewer-display-vnc.Tpo -c -o virt_viewer-display-vnc.o `test -f 'display-vnc.c' || echo '$(srcdir)/'`display-vnc.c
527 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-display-vnc.Tpo $(DEPDIR)/virt_viewer-display-vnc.Po
528 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
529 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='display-vnc.c' object='virt_viewer-display-vnc.o' libtool=no @AMDEPBACKSLASH@
530 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
531 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-display-vnc.o `test -f 'display-vnc.c' || echo '$(srcdir)/'`display-vnc.c
532
533 virt_viewer-display-vnc.obj: display-vnc.c
534 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-display-vnc.obj -MD -MP -MF $(DEPDIR)/virt_viewer-display-vnc.Tpo -c -o virt_viewer-display-vnc.obj `if test -f 'display-vnc.c'; then $(CYGPATH_W) 'display-vnc.c'; else $(CYGPATH_W) '$(srcdir)/display-vnc.c'; fi`
535 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-display-vnc.Tpo $(DEPDIR)/virt_viewer-display-vnc.Po
536 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
537 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='display-vnc.c' object='virt_viewer-display-vnc.obj' libtool=no @AMDEPBACKSLASH@
538 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
539 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-display-vnc.obj `if test -f 'display-vnc.c'; then $(CYGPATH_W) 'display-vnc.c'; else $(CYGPATH_W) '$(srcdir)/display-vnc.c'; fi`
540
541 virt_viewer-display-spice.o: display-spice.c
542 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-display-spice.o -MD -MP -MF $(DEPDIR)/virt_viewer-display-spice.Tpo -c -o virt_viewer-display-spice.o `test -f 'display-spice.c' || echo '$(srcdir)/'`display-spice.c
543 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-display-spice.Tpo $(DEPDIR)/virt_viewer-display-spice.Po
544 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
545 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='display-spice.c' object='virt_viewer-display-spice.o' libtool=no @AMDEPBACKSLASH@
546 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
547 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-display-spice.o `test -f 'display-spice.c' || echo '$(srcdir)/'`display-spice.c
548
549 virt_viewer-display-spice.obj: display-spice.c
550 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-display-spice.obj -MD -MP -MF $(DEPDIR)/virt_viewer-display-spice.Tpo -c -o virt_viewer-display-spice.obj `if test -f 'display-spice.c'; then $(CYGPATH_W) 'display-spice.c'; else $(CYGPATH_W) '$(srcdir)/display-spice.c'; fi`
551 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-display-spice.Tpo $(DEPDIR)/virt_viewer-display-spice.Po
552 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
553 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='display-spice.c' object='virt_viewer-display-spice.obj' libtool=no @AMDEPBACKSLASH@
554 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
555 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-display-spice.obj `if test -f 'display-spice.c'; then $(CYGPATH_W) 'display-spice.c'; else $(CYGPATH_W) '$(srcdir)/display-spice.c'; fi`
465 virt_viewer-virt-viewer-main.o: virt-viewer-main.c
466 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-main.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-main.Tpo -c -o virt_viewer-virt-viewer-main.o `test -f 'virt-viewer-main.c' || echo '$(srcdir)/'`virt-viewer-main.c
467 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-main.Tpo $(DEPDIR)/virt_viewer-virt-viewer-main.Po
468 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
469 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-main.c' object='virt_viewer-virt-viewer-main.o' libtool=no @AMDEPBACKSLASH@
470 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
471 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-main.o `test -f 'virt-viewer-main.c' || echo '$(srcdir)/'`virt-viewer-main.c
472
473 virt_viewer-virt-viewer-main.obj: virt-viewer-main.c
474 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-main.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-main.Tpo -c -o virt_viewer-virt-viewer-main.obj `if test -f 'virt-viewer-main.c'; then $(CYGPATH_W) 'virt-viewer-main.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-main.c'; fi`
475 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-main.Tpo $(DEPDIR)/virt_viewer-virt-viewer-main.Po
476 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
477 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-main.c' object='virt_viewer-virt-viewer-main.obj' libtool=no @AMDEPBACKSLASH@
478 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
479 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-main.obj `if test -f 'virt-viewer-main.c'; then $(CYGPATH_W) 'virt-viewer-main.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-main.c'; fi`
480
481 virt_viewer-virt-viewer-util.o: virt-viewer-util.c
482 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-util.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-util.Tpo -c -o virt_viewer-virt-viewer-util.o `test -f 'virt-viewer-util.c' || echo '$(srcdir)/'`virt-viewer-util.c
483 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-util.Tpo $(DEPDIR)/virt_viewer-virt-viewer-util.Po
484 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
485 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-util.c' object='virt_viewer-virt-viewer-util.o' libtool=no @AMDEPBACKSLASH@
486 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
487 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-util.o `test -f 'virt-viewer-util.c' || echo '$(srcdir)/'`virt-viewer-util.c
488
489 virt_viewer-virt-viewer-util.obj: virt-viewer-util.c
490 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-util.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-util.Tpo -c -o virt_viewer-virt-viewer-util.obj `if test -f 'virt-viewer-util.c'; then $(CYGPATH_W) 'virt-viewer-util.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-util.c'; fi`
491 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-util.Tpo $(DEPDIR)/virt_viewer-virt-viewer-util.Po
492 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
493 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-util.c' object='virt_viewer-virt-viewer-util.obj' libtool=no @AMDEPBACKSLASH@
494 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
495 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-util.obj `if test -f 'virt-viewer-util.c'; then $(CYGPATH_W) 'virt-viewer-util.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-util.c'; fi`
496
497 virt_viewer-virt-viewer-auth.o: virt-viewer-auth.c
498 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-auth.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-auth.Tpo -c -o virt_viewer-virt-viewer-auth.o `test -f 'virt-viewer-auth.c' || echo '$(srcdir)/'`virt-viewer-auth.c
499 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-auth.Tpo $(DEPDIR)/virt_viewer-virt-viewer-auth.Po
500 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
501 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-auth.c' object='virt_viewer-virt-viewer-auth.o' libtool=no @AMDEPBACKSLASH@
502 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
503 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-auth.o `test -f 'virt-viewer-auth.c' || echo '$(srcdir)/'`virt-viewer-auth.c
504
505 virt_viewer-virt-viewer-auth.obj: virt-viewer-auth.c
506 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-auth.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-auth.Tpo -c -o virt_viewer-virt-viewer-auth.obj `if test -f 'virt-viewer-auth.c'; then $(CYGPATH_W) 'virt-viewer-auth.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-auth.c'; fi`
507 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-auth.Tpo $(DEPDIR)/virt_viewer-virt-viewer-auth.Po
508 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
509 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-auth.c' object='virt_viewer-virt-viewer-auth.obj' libtool=no @AMDEPBACKSLASH@
510 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
511 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-auth.obj `if test -f 'virt-viewer-auth.c'; then $(CYGPATH_W) 'virt-viewer-auth.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-auth.c'; fi`
512
513 virt_viewer-virt-viewer-events.o: virt-viewer-events.c
514 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-events.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo -c -o virt_viewer-virt-viewer-events.o `test -f 'virt-viewer-events.c' || echo '$(srcdir)/'`virt-viewer-events.c
515 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer-virt-viewer-events.Po
516 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
517 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-events.c' object='virt_viewer-virt-viewer-events.o' libtool=no @AMDEPBACKSLASH@
518 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
519 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-events.o `test -f 'virt-viewer-events.c' || echo '$(srcdir)/'`virt-viewer-events.c
520
521 virt_viewer-virt-viewer-events.obj: virt-viewer-events.c
522 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-events.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo -c -o virt_viewer-virt-viewer-events.obj `if test -f 'virt-viewer-events.c'; then $(CYGPATH_W) 'virt-viewer-events.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-events.c'; fi`
523 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-events.Tpo $(DEPDIR)/virt_viewer-virt-viewer-events.Po
524 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
525 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-events.c' object='virt_viewer-virt-viewer-events.obj' libtool=no @AMDEPBACKSLASH@
526 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
527 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-events.obj `if test -f 'virt-viewer-events.c'; then $(CYGPATH_W) 'virt-viewer-events.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-events.c'; fi`
528
529 virt_viewer-virt-viewer.o: virt-viewer.c
530 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer.Tpo -c -o virt_viewer-virt-viewer.o `test -f 'virt-viewer.c' || echo '$(srcdir)/'`virt-viewer.c
531 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer.Tpo $(DEPDIR)/virt_viewer-virt-viewer.Po
532 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
533 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer.c' object='virt_viewer-virt-viewer.o' libtool=no @AMDEPBACKSLASH@
534 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
535 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer.o `test -f 'virt-viewer.c' || echo '$(srcdir)/'`virt-viewer.c
536
537 virt_viewer-virt-viewer.obj: virt-viewer.c
538 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer.Tpo -c -o virt_viewer-virt-viewer.obj `if test -f 'virt-viewer.c'; then $(CYGPATH_W) 'virt-viewer.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer.c'; fi`
539 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer.Tpo $(DEPDIR)/virt_viewer-virt-viewer.Po
540 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
541 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer.c' object='virt_viewer-virt-viewer.obj' libtool=no @AMDEPBACKSLASH@
542 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
543 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer.obj `if test -f 'virt-viewer.c'; then $(CYGPATH_W) 'virt-viewer.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer.c'; fi`
544
545 virt_viewer-virt-viewer-session.o: virt-viewer-session.c
546 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session.Tpo -c -o virt_viewer-virt-viewer-session.o `test -f 'virt-viewer-session.c' || echo '$(srcdir)/'`virt-viewer-session.c
547 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session.Po
548 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
549 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session.c' object='virt_viewer-virt-viewer-session.o' libtool=no @AMDEPBACKSLASH@
550 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
551 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session.o `test -f 'virt-viewer-session.c' || echo '$(srcdir)/'`virt-viewer-session.c
552
553 virt_viewer-virt-viewer-session.obj: virt-viewer-session.c
554 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session.Tpo -c -o virt_viewer-virt-viewer-session.obj `if test -f 'virt-viewer-session.c'; then $(CYGPATH_W) 'virt-viewer-session.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session.c'; fi`
555 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session.Po
556 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
557 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session.c' object='virt_viewer-virt-viewer-session.obj' libtool=no @AMDEPBACKSLASH@
558 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
559 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session.obj `if test -f 'virt-viewer-session.c'; then $(CYGPATH_W) 'virt-viewer-session.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session.c'; fi`
560
561 virt_viewer-virt-viewer-session-vnc.o: virt-viewer-session-vnc.c
562 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session-vnc.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Tpo -c -o virt_viewer-virt-viewer-session-vnc.o `test -f 'virt-viewer-session-vnc.c' || echo '$(srcdir)/'`virt-viewer-session-vnc.c
563 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Po
564 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
565 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-vnc.c' object='virt_viewer-virt-viewer-session-vnc.o' libtool=no @AMDEPBACKSLASH@
566 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
567 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session-vnc.o `test -f 'virt-viewer-session-vnc.c' || echo '$(srcdir)/'`virt-viewer-session-vnc.c
568
569 virt_viewer-virt-viewer-session-vnc.obj: virt-viewer-session-vnc.c
570 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session-vnc.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Tpo -c -o virt_viewer-virt-viewer-session-vnc.obj `if test -f 'virt-viewer-session-vnc.c'; then $(CYGPATH_W) 'virt-viewer-session-vnc.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session-vnc.c'; fi`
571 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-vnc.Po
572 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
573 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-vnc.c' object='virt_viewer-virt-viewer-session-vnc.obj' libtool=no @AMDEPBACKSLASH@
574 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
575 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session-vnc.obj `if test -f 'virt-viewer-session-vnc.c'; then $(CYGPATH_W) 'virt-viewer-session-vnc.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session-vnc.c'; fi`
576
577 virt_viewer-virt-viewer-display.o: virt-viewer-display.c
578 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display.Tpo -c -o virt_viewer-virt-viewer-display.o `test -f 'virt-viewer-display.c' || echo '$(srcdir)/'`virt-viewer-display.c
579 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display.Po
580 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
581 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display.c' object='virt_viewer-virt-viewer-display.o' libtool=no @AMDEPBACKSLASH@
582 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
583 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display.o `test -f 'virt-viewer-display.c' || echo '$(srcdir)/'`virt-viewer-display.c
584
585 virt_viewer-virt-viewer-display.obj: virt-viewer-display.c
586 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display.Tpo -c -o virt_viewer-virt-viewer-display.obj `if test -f 'virt-viewer-display.c'; then $(CYGPATH_W) 'virt-viewer-display.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display.c'; fi`
587 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display.Po
588 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
589 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display.c' object='virt_viewer-virt-viewer-display.obj' libtool=no @AMDEPBACKSLASH@
590 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
591 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display.obj `if test -f 'virt-viewer-display.c'; then $(CYGPATH_W) 'virt-viewer-display.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display.c'; fi`
592
593 virt_viewer-virt-viewer-display-vnc.o: virt-viewer-display-vnc.c
594 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display-vnc.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Tpo -c -o virt_viewer-virt-viewer-display-vnc.o `test -f 'virt-viewer-display-vnc.c' || echo '$(srcdir)/'`virt-viewer-display-vnc.c
595 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Po
596 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
597 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-vnc.c' object='virt_viewer-virt-viewer-display-vnc.o' libtool=no @AMDEPBACKSLASH@
598 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
599 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display-vnc.o `test -f 'virt-viewer-display-vnc.c' || echo '$(srcdir)/'`virt-viewer-display-vnc.c
600
601 virt_viewer-virt-viewer-display-vnc.obj: virt-viewer-display-vnc.c
602 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display-vnc.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Tpo -c -o virt_viewer-virt-viewer-display-vnc.obj `if test -f 'virt-viewer-display-vnc.c'; then $(CYGPATH_W) 'virt-viewer-display-vnc.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display-vnc.c'; fi`
603 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-vnc.Po
604 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
605 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-vnc.c' object='virt_viewer-virt-viewer-display-vnc.obj' libtool=no @AMDEPBACKSLASH@
606 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
607 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display-vnc.obj `if test -f 'virt-viewer-display-vnc.c'; then $(CYGPATH_W) 'virt-viewer-display-vnc.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display-vnc.c'; fi`
608
609 virt_viewer-autoDrawer.o: view/autoDrawer.c
610 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-autoDrawer.o -MD -MP -MF $(DEPDIR)/virt_viewer-autoDrawer.Tpo -c -o virt_viewer-autoDrawer.o `test -f 'view/autoDrawer.c' || echo '$(srcdir)/'`view/autoDrawer.c
611 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-autoDrawer.Tpo $(DEPDIR)/virt_viewer-autoDrawer.Po
612 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
613 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/autoDrawer.c' object='virt_viewer-autoDrawer.o' libtool=no @AMDEPBACKSLASH@
614 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
615 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-autoDrawer.o `test -f 'view/autoDrawer.c' || echo '$(srcdir)/'`view/autoDrawer.c
616
617 virt_viewer-autoDrawer.obj: view/autoDrawer.c
618 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-autoDrawer.obj -MD -MP -MF $(DEPDIR)/virt_viewer-autoDrawer.Tpo -c -o virt_viewer-autoDrawer.obj `if test -f 'view/autoDrawer.c'; then $(CYGPATH_W) 'view/autoDrawer.c'; else $(CYGPATH_W) '$(srcdir)/view/autoDrawer.c'; fi`
619 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-autoDrawer.Tpo $(DEPDIR)/virt_viewer-autoDrawer.Po
620 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
621 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/autoDrawer.c' object='virt_viewer-autoDrawer.obj' libtool=no @AMDEPBACKSLASH@
622 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
623 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-autoDrawer.obj `if test -f 'view/autoDrawer.c'; then $(CYGPATH_W) 'view/autoDrawer.c'; else $(CYGPATH_W) '$(srcdir)/view/autoDrawer.c'; fi`
624
625 virt_viewer-drawer.o: view/drawer.c
626 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-drawer.o -MD -MP -MF $(DEPDIR)/virt_viewer-drawer.Tpo -c -o virt_viewer-drawer.o `test -f 'view/drawer.c' || echo '$(srcdir)/'`view/drawer.c
627 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-drawer.Tpo $(DEPDIR)/virt_viewer-drawer.Po
628 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
629 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/drawer.c' object='virt_viewer-drawer.o' libtool=no @AMDEPBACKSLASH@
630 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
631 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-drawer.o `test -f 'view/drawer.c' || echo '$(srcdir)/'`view/drawer.c
632
633 virt_viewer-drawer.obj: view/drawer.c
634 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-drawer.obj -MD -MP -MF $(DEPDIR)/virt_viewer-drawer.Tpo -c -o virt_viewer-drawer.obj `if test -f 'view/drawer.c'; then $(CYGPATH_W) 'view/drawer.c'; else $(CYGPATH_W) '$(srcdir)/view/drawer.c'; fi`
635 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-drawer.Tpo $(DEPDIR)/virt_viewer-drawer.Po
636 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
637 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/drawer.c' object='virt_viewer-drawer.obj' libtool=no @AMDEPBACKSLASH@
638 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
639 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-drawer.obj `if test -f 'view/drawer.c'; then $(CYGPATH_W) 'view/drawer.c'; else $(CYGPATH_W) '$(srcdir)/view/drawer.c'; fi`
640
641 virt_viewer-ovBox.o: view/ovBox.c
642 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-ovBox.o -MD -MP -MF $(DEPDIR)/virt_viewer-ovBox.Tpo -c -o virt_viewer-ovBox.o `test -f 'view/ovBox.c' || echo '$(srcdir)/'`view/ovBox.c
643 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-ovBox.Tpo $(DEPDIR)/virt_viewer-ovBox.Po
644 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
645 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/ovBox.c' object='virt_viewer-ovBox.o' libtool=no @AMDEPBACKSLASH@
646 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
647 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-ovBox.o `test -f 'view/ovBox.c' || echo '$(srcdir)/'`view/ovBox.c
648
649 virt_viewer-ovBox.obj: view/ovBox.c
650 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-ovBox.obj -MD -MP -MF $(DEPDIR)/virt_viewer-ovBox.Tpo -c -o virt_viewer-ovBox.obj `if test -f 'view/ovBox.c'; then $(CYGPATH_W) 'view/ovBox.c'; else $(CYGPATH_W) '$(srcdir)/view/ovBox.c'; fi`
651 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-ovBox.Tpo $(DEPDIR)/virt_viewer-ovBox.Po
652 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
653 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='view/ovBox.c' object='virt_viewer-ovBox.obj' libtool=no @AMDEPBACKSLASH@
654 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
655 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-ovBox.obj `if test -f 'view/ovBox.c'; then $(CYGPATH_W) 'view/ovBox.c'; else $(CYGPATH_W) '$(srcdir)/view/ovBox.c'; fi`
656
657 virt_viewer-virt-viewer-session-spice.o: virt-viewer-session-spice.c
658 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session-spice.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Tpo -c -o virt_viewer-virt-viewer-session-spice.o `test -f 'virt-viewer-session-spice.c' || echo '$(srcdir)/'`virt-viewer-session-spice.c
659 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Po
660 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
661 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-spice.c' object='virt_viewer-virt-viewer-session-spice.o' libtool=no @AMDEPBACKSLASH@
662 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
663 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session-spice.o `test -f 'virt-viewer-session-spice.c' || echo '$(srcdir)/'`virt-viewer-session-spice.c
664
665 virt_viewer-virt-viewer-session-spice.obj: virt-viewer-session-spice.c
666 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-session-spice.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Tpo -c -o virt_viewer-virt-viewer-session-spice.obj `if test -f 'virt-viewer-session-spice.c'; then $(CYGPATH_W) 'virt-viewer-session-spice.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session-spice.c'; fi`
667 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-session-spice.Po
668 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
669 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-session-spice.c' object='virt_viewer-virt-viewer-session-spice.obj' libtool=no @AMDEPBACKSLASH@
670 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
671 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-session-spice.obj `if test -f 'virt-viewer-session-spice.c'; then $(CYGPATH_W) 'virt-viewer-session-spice.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-session-spice.c'; fi`
672
673 virt_viewer-virt-viewer-display-spice.o: virt-viewer-display-spice.c
674 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display-spice.o -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Tpo -c -o virt_viewer-virt-viewer-display-spice.o `test -f 'virt-viewer-display-spice.c' || echo '$(srcdir)/'`virt-viewer-display-spice.c
675 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Po
676 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
677 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-spice.c' object='virt_viewer-virt-viewer-display-spice.o' libtool=no @AMDEPBACKSLASH@
678 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
679 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display-spice.o `test -f 'virt-viewer-display-spice.c' || echo '$(srcdir)/'`virt-viewer-display-spice.c
680
681 virt_viewer-virt-viewer-display-spice.obj: virt-viewer-display-spice.c
682 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -MT virt_viewer-virt-viewer-display-spice.obj -MD -MP -MF $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Tpo -c -o virt_viewer-virt-viewer-display-spice.obj `if test -f 'virt-viewer-display-spice.c'; then $(CYGPATH_W) 'virt-viewer-display-spice.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display-spice.c'; fi`
683 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Tpo $(DEPDIR)/virt_viewer-virt-viewer-display-spice.Po
684 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
685 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='virt-viewer-display-spice.c' object='virt_viewer-virt-viewer-display-spice.obj' libtool=no @AMDEPBACKSLASH@
686 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
687 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_viewer_CFLAGS) $(CFLAGS) -c -o virt_viewer-virt-viewer-display-spice.obj `if test -f 'virt-viewer-display-spice.c'; then $(CYGPATH_W) 'virt-viewer-display-spice.c'; else $(CYGPATH_W) '$(srcdir)/virt-viewer-display-spice.c'; fi`
556688
557689 mostlyclean-libtool:
558690 -rm -f *.lo
559691
560692 clean-libtool:
561693 -rm -rf .libs _libs
562 install-gladeDATA: $(glade_DATA)
694 install-builderxmlDATA: $(builderxml_DATA)
563695 @$(NORMAL_INSTALL)
564 test -z "$(gladedir)" || $(MKDIR_P) "$(DESTDIR)$(gladedir)"
565 @list='$(glade_DATA)'; test -n "$(gladedir)" || list=; \
696 test -z "$(builderxmldir)" || $(MKDIR_P) "$(DESTDIR)$(builderxmldir)"
697 @list='$(builderxml_DATA)'; test -n "$(builderxmldir)" || list=; \
566698 for p in $$list; do \
567699 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
568700 echo "$$d$$p"; \
569701 done | $(am__base_list) | \
570702 while read files; do \
571 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(gladedir)'"; \
572 $(INSTALL_DATA) $$files "$(DESTDIR)$(gladedir)" || exit $$?; \
703 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(builderxmldir)'"; \
704 $(INSTALL_DATA) $$files "$(DESTDIR)$(builderxmldir)" || exit $$?; \
573705 done
574706
575 uninstall-gladeDATA:
707 uninstall-builderxmlDATA:
576708 @$(NORMAL_UNINSTALL)
577 @list='$(glade_DATA)'; test -n "$(gladedir)" || list=; \
709 @list='$(builderxml_DATA)'; test -n "$(builderxmldir)" || list=; \
578710 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
579711 test -n "$$files" || exit 0; \
580 echo " ( cd '$(DESTDIR)$(gladedir)' && rm -f" $$files ")"; \
581 cd "$(DESTDIR)$(gladedir)" && rm -f $$files
712 echo " ( cd '$(DESTDIR)$(builderxmldir)' && rm -f" $$files ")"; \
713 cd "$(DESTDIR)$(builderxmldir)" && rm -f $$files
582714
583715 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
584716 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
666798 check: check-am
667799 all-am: Makefile $(PROGRAMS) $(DATA)
668800 installdirs:
669 for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gladedir)"; do \
801 for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(builderxmldir)"; do \
670802 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
671803 done
672804 install: install-am
716848
717849 info-am:
718850
719 install-data-am: install-gladeDATA
851 install-data-am: install-builderxmlDATA
720852
721853 install-dvi: install-dvi-am
722854
762894
763895 ps-am:
764896
765 uninstall-am: uninstall-binPROGRAMS uninstall-gladeDATA
897 uninstall-am: uninstall-binPROGRAMS uninstall-builderxmlDATA
766898
767899 .MAKE: install-am install-strip
768900
770902 clean-generic clean-libtool ctags distclean distclean-compile \
771903 distclean-generic distclean-libtool distclean-tags distdir dvi \
772904 dvi-am html html-am info info-am install install-am \
773 install-binPROGRAMS install-data install-data-am install-dvi \
774 install-dvi-am install-exec install-exec-am install-gladeDATA \
775 install-html install-html-am install-info install-info-am \
776 install-man install-pdf install-pdf-am install-ps \
777 install-ps-am install-strip installcheck installcheck-am \
778 installdirs maintainer-clean maintainer-clean-generic \
779 mostlyclean mostlyclean-compile mostlyclean-generic \
780 mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
781 uninstall-am uninstall-binPROGRAMS uninstall-gladeDATA
905 install-binPROGRAMS install-builderxmlDATA install-data \
906 install-data-am install-dvi install-dvi-am install-exec \
907 install-exec-am install-html install-html-am install-info \
908 install-info-am install-man install-pdf install-pdf-am \
909 install-ps install-ps-am install-strip installcheck \
910 installcheck-am installdirs maintainer-clean \
911 maintainer-clean-generic mostlyclean mostlyclean-compile \
912 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
913 tags uninstall uninstall-am uninstall-binPROGRAMS \
914 uninstall-builderxmlDATA
782915
783916
784917 # Tell versions [3.59,3.63) of GNU make to not export all variables.
+0
-56
src/about.glade less more
0 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
2 <!--Generated with glade3 3.4.5 on Wed Nov 26 12:15:46 2008 -->
3 <glade-interface>
4 <widget class="GtkAboutDialog" id="about">
5 <property name="border_width">5</property>
6 <property name="title" translatable="yes">About Glade</property>
7 <property name="resizable">False</property>
8 <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
9 <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
10 <property name="has_separator">False</property>
11 <property name="program_name">Virtual Machine Viewer</property>
12 <property name="copyright" translatable="yes">Copyright 2007-2008 Daniel P. Berrange
13 Copyright 2007-2008 Red Hat, Inc.</property>
14 <property name="comments" translatable="yes">A remote desktop client built with GTK-VNC and libvirt</property>
15 <property name="website">http://virt-manager.org/</property>
16 <property name="website_label" translatable="yes">virt-manager.org</property>
17 <property name="license" translatable="yes">This program is free software; you can redistribute it and/or modify
18 it under the terms of the GNU General Public License as published by
19 the Free Software Foundation; either version 2 of the License, or
20 (at your option) any later version.
21
22 This program is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 GNU General Public License for more details.
26
27 You should have received a copy of the GNU General Public License
28 along with this program; if not, write to the Free Software
29 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 </property>
31 <property name="authors">Daniel P. Berrange</property>
32 <property name="translator_credits" translatable="yes">The Fedora Translation Team</property>
33 <signal name="delete_event" handler="about_delete"/>
34 <signal name="response" handler="about_close"/>
35 <child internal-child="vbox">
36 <widget class="GtkVBox" id="dialog-vbox1">
37 <property name="visible">True</property>
38 <property name="spacing">2</property>
39 <child>
40 <placeholder/>
41 </child>
42 <child internal-child="action_area">
43 <widget class="GtkHButtonBox" id="dialog-action_area1">
44 <property name="visible">True</property>
45 <property name="layout_style">GTK_BUTTONBOX_END</property>
46 </widget>
47 <packing>
48 <property name="expand">False</property>
49 <property name="pack_type">GTK_PACK_END</property>
50 </packing>
51 </child>
52 </widget>
53 </child>
54 </widget>
55 </glade-interface>
+0
-232
src/auth.c less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #include <config.h>
23
24 #include <vncdisplay.h>
25 #include <gtk/gtk.h>
26 #include <glade/glade.h>
27 #include <string.h>
28
29 #include "auth.h"
30
31
32 int viewer_auth_collect_credentials(const char *type, const char *address,
33 char **username, char **password)
34 {
35 GtkWidget *dialog = NULL;
36 GladeXML *creds = viewer_load_glade("auth.glade", "auth");
37 GtkWidget *credUsername;
38 GtkWidget *credPassword;
39 GtkWidget *promptUsername;
40 GtkWidget *promptPassword;
41 GtkWidget *labelMessage;
42 int response;
43 char *message;
44
45 dialog = glade_xml_get_widget(creds, "auth");
46 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
47
48 labelMessage = glade_xml_get_widget(creds, "message");
49 credUsername = glade_xml_get_widget(creds, "cred-username");
50 promptUsername = glade_xml_get_widget(creds, "prompt-username");
51 credPassword = glade_xml_get_widget(creds, "cred-password");
52 promptPassword = glade_xml_get_widget(creds, "prompt-password");
53
54 gtk_widget_set_sensitive(credUsername, username != NULL);
55 gtk_widget_set_sensitive(promptUsername, username != NULL);
56 gtk_widget_set_sensitive(credPassword, password != NULL);
57 gtk_widget_set_sensitive(promptPassword, password != NULL);
58
59 if (address) {
60 message = g_strdup_printf("Authentication is required for the %s connection to:\n\n"
61 "<b>%s</b>\n\n",
62 type,
63 address ? address : "[unknown]");
64 } else {
65 message = g_strdup_printf("Authentication is required for the %s connection:\n",
66 type);
67 }
68
69 gtk_label_set_markup(GTK_LABEL(labelMessage), message);
70 g_free(message);
71
72 gtk_widget_show_all(dialog);
73 response = gtk_dialog_run(GTK_DIALOG(dialog));
74 gtk_widget_hide(dialog);
75
76 if (response == GTK_RESPONSE_OK) {
77 if (username)
78 *username = g_strdup(gtk_entry_get_text(GTK_ENTRY(credUsername)));
79 if (password)
80 *password = g_strdup(gtk_entry_get_text(GTK_ENTRY(credPassword)));
81 }
82
83 gtk_widget_destroy(GTK_WIDGET(dialog));
84
85 return response == GTK_RESPONSE_OK ? 0 : -1;
86 }
87
88 void viewer_auth_vnc_credentials(GtkWidget *vnc, GValueArray *credList, char **vncAddress)
89 {
90 char *username = NULL, *password = NULL;
91 gboolean wantPassword = FALSE, wantUsername = FALSE;
92 int i;
93
94 DEBUG_LOG("Got VNC credential request for %d credential(s)", credList->n_values);
95
96 for (i = 0 ; i < credList->n_values ; i++) {
97 GValue *cred = g_value_array_get_nth(credList, i);
98 switch (g_value_get_enum(cred)) {
99 case VNC_DISPLAY_CREDENTIAL_USERNAME:
100 wantUsername = TRUE;
101 break;
102 case VNC_DISPLAY_CREDENTIAL_PASSWORD:
103 wantPassword = TRUE;
104 break;
105 case VNC_DISPLAY_CREDENTIAL_CLIENTNAME:
106 break;
107 default:
108 DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred));
109 vnc_display_close(VNC_DISPLAY(vnc));
110 goto cleanup;
111 }
112 }
113
114 if (wantUsername || wantPassword) {
115 int ret = viewer_auth_collect_credentials("VNC", vncAddress ? *vncAddress : NULL,
116 wantUsername ? &username : NULL,
117 wantPassword ? &password : NULL);
118
119 if (ret < 0) {
120 vnc_display_close(VNC_DISPLAY(vnc));
121 goto cleanup;
122 }
123 }
124
125 for (i = 0 ; i < credList->n_values ; i++) {
126 GValue *cred = g_value_array_get_nth(credList, i);
127 switch (g_value_get_enum(cred)) {
128 case VNC_DISPLAY_CREDENTIAL_USERNAME:
129 if (!username ||
130 vnc_display_set_credential(VNC_DISPLAY(vnc),
131 g_value_get_enum(cred),
132 username)) {
133 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
134 vnc_display_close(VNC_DISPLAY(vnc));
135 }
136 break;
137 case VNC_DISPLAY_CREDENTIAL_PASSWORD:
138 if (!password ||
139 vnc_display_set_credential(VNC_DISPLAY(vnc),
140 g_value_get_enum(cred),
141 password)) {
142 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
143 vnc_display_close(VNC_DISPLAY(vnc));
144 }
145 break;
146 case VNC_DISPLAY_CREDENTIAL_CLIENTNAME:
147 if (vnc_display_set_credential(VNC_DISPLAY(vnc),
148 g_value_get_enum(cred),
149 "libvirt")) {
150 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
151 vnc_display_close(VNC_DISPLAY(vnc));
152 }
153 break;
154 default:
155 DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred));
156 vnc_display_close(VNC_DISPLAY(vnc));
157 }
158 }
159
160 cleanup:
161 g_free(username);
162 g_free(password);
163 }
164
165
166
167 int
168 viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
169 unsigned int ncred,
170 void *cbdata)
171 {
172 char **username = NULL, **password = NULL;
173 const char *uri = cbdata;
174 int i;
175 int ret = -1;
176
177 DEBUG_LOG("Got libvirt credential request for %d credential(s)", ncred);
178
179 for (i = 0 ; i < ncred ; i++) {
180 switch (cred[i].type) {
181 case VIR_CRED_USERNAME:
182 case VIR_CRED_AUTHNAME:
183 username = &cred[i].result;
184 break;
185 case VIR_CRED_PASSPHRASE:
186 password = &cred[i].result;
187 break;
188 default:
189 DEBUG_LOG("Unsupported libvirt credential %d", cred[i].type);
190 return -1;
191 }
192 }
193
194 if (username || password) {
195 ret = viewer_auth_collect_credentials("libvirt", uri,
196 username, password);
197 if (ret < 0)
198 goto cleanup;
199 } else {
200 ret = 0;
201 }
202
203 for (i = 0 ; i < ncred ; i++) {
204 switch (cred[i].type) {
205 case VIR_CRED_AUTHNAME:
206 case VIR_CRED_USERNAME:
207 case VIR_CRED_PASSPHRASE:
208 if (cred[i].result)
209 cred[i].resultlen = strlen(cred[i].result);
210 else
211 cred[i].resultlen = 0;
212 DEBUG_LOG("Got '%s' %d %d", cred[i].result, cred[i].resultlen, cred[i].type);
213 break;
214 }
215 }
216
217 cleanup:
218 DEBUG_LOG("Return %d", ret);
219 return ret;
220 }
221
222
223
224
225 /*
226 * Local variables:
227 * c-indent-level: 8
228 * c-basic-offset: 8
229 * tab-width: 8
230 * End:
231 */
+0
-118
src/auth.glade less more
0 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
2 <!--Generated with glade3 3.4.5 on Wed Nov 26 18:01:48 2008 -->
3 <glade-interface>
4 <widget class="GtkDialog" id="auth">
5 <property name="border_width">5</property>
6 <property name="title" translatable="yes">Authentication required</property>
7 <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
8 <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
9 <property name="has_separator">False</property>
10 <child internal-child="vbox">
11 <widget class="GtkVBox" id="dialog-vbox1">
12 <property name="visible">True</property>
13 <property name="spacing">2</property>
14 <child>
15 <widget class="GtkLabel" id="message">
16 <property name="visible">True</property>
17 <property name="xalign">0</property>
18 <property name="yalign">0</property>
19 <property name="label" translatable="yes">label</property>
20 <property name="use_markup">True</property>
21 </widget>
22 <packing>
23 <property name="position">1</property>
24 </packing>
25 </child>
26 <child>
27 <widget class="GtkTable" id="table1">
28 <property name="visible">True</property>
29 <property name="n_rows">2</property>
30 <property name="n_columns">2</property>
31 <property name="column_spacing">6</property>
32 <property name="row_spacing">6</property>
33 <child>
34 <widget class="GtkLabel" id="prompt-password">
35 <property name="visible">True</property>
36 <property name="xalign">1</property>
37 <property name="label" translatable="yes">Password:</property>
38 </widget>
39 <packing>
40 <property name="top_attach">1</property>
41 <property name="bottom_attach">2</property>
42 </packing>
43 </child>
44 <child>
45 <widget class="GtkLabel" id="prompt-username">
46 <property name="visible">True</property>
47 <property name="xalign">1</property>
48 <property name="label" translatable="yes">Username:</property>
49 </widget>
50 </child>
51 <child>
52 <widget class="GtkEntry" id="cred-username">
53 <property name="visible">True</property>
54 <property name="can_focus">True</property>
55 </widget>
56 <packing>
57 <property name="left_attach">1</property>
58 <property name="right_attach">2</property>
59 </packing>
60 </child>
61 <child>
62 <widget class="GtkEntry" id="cred-password">
63 <property name="visible">True</property>
64 <property name="can_focus">True</property>
65 <property name="visibility">False</property>
66 </widget>
67 <packing>
68 <property name="left_attach">1</property>
69 <property name="right_attach">2</property>
70 <property name="top_attach">1</property>
71 <property name="bottom_attach">2</property>
72 </packing>
73 </child>
74 </widget>
75 <packing>
76 <property name="position">2</property>
77 </packing>
78 </child>
79 <child internal-child="action_area">
80 <widget class="GtkHButtonBox" id="dialog-action_area1">
81 <property name="visible">True</property>
82 <property name="layout_style">GTK_BUTTONBOX_END</property>
83 <child>
84 <widget class="GtkButton" id="button-cancel">
85 <property name="visible">True</property>
86 <property name="can_focus">True</property>
87 <property name="receives_default">True</property>
88 <property name="label" translatable="yes">gtk-cancel</property>
89 <property name="use_stock">True</property>
90 <property name="response_id">-6</property>
91 </widget>
92 </child>
93 <child>
94 <widget class="GtkButton" id="button-ok">
95 <property name="visible">True</property>
96 <property name="can_focus">True</property>
97 <property name="can_default">True</property>
98 <property name="has_default">True</property>
99 <property name="receives_default">True</property>
100 <property name="label" translatable="yes">gtk-ok</property>
101 <property name="use_stock">True</property>
102 <property name="response_id">-5</property>
103 </widget>
104 <packing>
105 <property name="position">3</property>
106 </packing>
107 </child>
108 </widget>
109 <packing>
110 <property name="expand">False</property>
111 <property name="pack_type">GTK_PACK_END</property>
112 </packing>
113 </child>
114 </widget>
115 </child>
116 </widget>
117 </glade-interface>
+0
-39
src/auth.h less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #ifndef VIRT_VIEWER_AUTH_H
23 #define VIRT_VIEWER_AUTH_H
24
25 #include <libvirt/libvirt.h>
26
27 #include "util.h"
28
29 void viewer_auth_vnc_credentials(GtkWidget *vnc, GValueArray *credList, char **message);
30
31 int viewer_auth_collect_credentials(const char *type, const char *address,
32 char **username, char **password);
33
34 int viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
35 unsigned int ncred,
36 void *cbdata);
37
38 #endif
+0
-284
src/display-spice.c less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23
24 #include <spice-audio.h>
25 #include "util.h"
26 #include "display-spice.h"
27 #include "auth.h"
28
29 G_DEFINE_TYPE (VirtViewerDisplaySpice, virt_viewer_display_spice, VIRT_VIEWER_TYPE_DISPLAY)
30
31
32 static void _spice_close(VirtViewerDisplay* display);
33 static void _spice_send_keys(VirtViewerDisplay* display, const guint *keyvals, int nkeyvals);
34 static GdkPixbuf* _spice_get_pixbuf(VirtViewerDisplay* display);
35 static gboolean _spice_open_fd(VirtViewerDisplay* display, int fd);
36 static gboolean _spice_open_host(VirtViewerDisplay* display, char *host, char *port);
37 static gboolean _spice_channel_open_fd(VirtViewerDisplay* display, VirtViewerDisplayChannel* channel, int fd);
38
39
40 static void
41 virt_viewer_display_spice_class_init(VirtViewerDisplaySpiceClass *klass)
42 {
43 VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass);
44
45 dclass->close = _spice_close;
46 dclass->send_keys = _spice_send_keys;
47 dclass->get_pixbuf = _spice_get_pixbuf;
48 dclass->open_fd = _spice_open_fd;
49 dclass->open_host = _spice_open_host;
50 dclass->channel_open_fd = _spice_channel_open_fd;
51 }
52
53 static void
54 virt_viewer_display_spice_init(VirtViewerDisplaySpice *self G_GNUC_UNUSED)
55 {
56 }
57
58 static void _spice_send_keys(VirtViewerDisplay* display, const guint *keyvals, int nkeyvals)
59 {
60 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
61
62 g_return_if_fail(self != NULL);
63 g_return_if_fail(self->display != NULL);
64
65 spice_display_send_keys(self->display, keyvals, nkeyvals, SPICE_DISPLAY_KEY_EVENT_CLICK);
66 }
67
68 static GdkPixbuf* _spice_get_pixbuf(VirtViewerDisplay* display)
69 {
70 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
71
72 g_return_val_if_fail(self != NULL, NULL);
73 g_return_val_if_fail(self->display != NULL, NULL);
74
75 return spice_display_get_pixbuf(self->display);
76 }
77
78 static void _spice_close(VirtViewerDisplay* display)
79 {
80 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
81
82 g_return_if_fail(self != NULL);
83
84 if (self->session == NULL)
85 return;
86
87 spice_session_disconnect(self->session);
88
89 if (self->session) /* let viewer_quit() be reentrant */
90 g_object_unref(self->session);
91 self->session = NULL;
92
93 if (self->audio)
94 g_object_unref(self->audio);
95 self->audio = NULL;
96 }
97
98 static gboolean _spice_open_host(VirtViewerDisplay* display, char *host, char *port)
99 {
100 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
101
102 g_return_val_if_fail(self != NULL, FALSE);
103 g_return_val_if_fail(self->session != NULL, FALSE);
104
105 g_object_set(self->session,
106 "host", host,
107 "port", port,
108 NULL);
109
110 return spice_session_connect(self->session);
111 }
112
113 static gboolean _spice_open_fd(VirtViewerDisplay* display, int fd)
114 {
115 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
116
117 g_return_val_if_fail(self != NULL, FALSE);
118
119 return spice_session_open_fd(self->session, fd);
120 }
121
122 static gboolean _spice_channel_open_fd(VirtViewerDisplay* display,
123 VirtViewerDisplayChannel* channel, int fd)
124 {
125 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
126
127 g_return_val_if_fail(self != NULL, FALSE);
128
129 return spice_channel_open_fd(SPICE_CHANNEL(channel), fd);
130 }
131
132 static void _spice_channel_open_fd_request(SpiceChannel *channel,
133 G_GNUC_UNUSED gint tls,
134 VirtViewerDisplay *display)
135 {
136 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
137
138 g_return_if_fail(self != NULL);
139
140 viewer_channel_open_fd(display->viewer, (VirtViewerDisplayChannel *)channel);
141 }
142
143 static void _spice_main_channel_event(G_GNUC_UNUSED SpiceChannel *channel,
144 SpiceChannelEvent event,
145 VirtViewerDisplay *display)
146 {
147 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
148 char *password = NULL;
149
150 g_return_if_fail(self != NULL);
151 g_return_if_fail(display->viewer != NULL);
152
153 switch (event) {
154 case SPICE_CHANNEL_OPENED:
155 DEBUG_LOG("main channel: opened");
156 break;
157 case SPICE_CHANNEL_CLOSED:
158 DEBUG_LOG("main channel: closed");
159 viewer_quit(display->viewer);
160 break;
161 case SPICE_CHANNEL_ERROR_CONNECT:
162 DEBUG_LOG("main channel: failed to connect");
163 viewer_disconnected(display->viewer);
164 break;
165 case SPICE_CHANNEL_ERROR_AUTH:
166 DEBUG_LOG("main channel: auth failure (wrong password?)");
167 int ret = viewer_auth_collect_credentials("SPICE",
168 display->viewer->pretty_address,
169 NULL, &password);
170 if (ret < 0) {
171 viewer_quit(display->viewer);
172 } else {
173 g_object_set(self->session, "password", password, NULL);
174 spice_session_connect(self->session);
175 }
176 break;
177 default:
178 g_warning("unknown main channel event: %d", event);
179 viewer_disconnected(display->viewer);
180 break;
181 }
182
183 g_free(password);
184 }
185
186 static void _spice_channel_new(SpiceSession *s, SpiceChannel *channel,
187 VirtViewerDisplay *display)
188 {
189 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
190 int id;
191
192 g_return_if_fail(self != NULL);
193
194 g_signal_connect(channel, "open-fd",
195 G_CALLBACK(_spice_channel_open_fd_request), self);
196
197 g_object_get(channel, "channel-id", &id, NULL);
198
199 if (SPICE_IS_MAIN_CHANNEL(channel)) {
200 g_signal_connect(channel, "channel-event",
201 G_CALLBACK(_spice_main_channel_event), self);
202 }
203
204 if (SPICE_IS_DISPLAY_CHANNEL(channel)) {
205 DEBUG_LOG("new display channel (#%d)", id);
206 if (display->widget != NULL)
207 return;
208 self->display = spice_display_new(s, id);
209 display->widget = GTK_WIDGET(self->display);
210 g_object_set(self->display,
211 "grab-keyboard", TRUE,
212 "grab-mouse", TRUE,
213 "resize-guest", TRUE,
214 "auto-clipboard", TRUE,
215 NULL);
216 viewer_add_display_and_realize(display->viewer);
217 viewer_initialized(display->viewer);
218 }
219
220 if (SPICE_IS_INPUTS_CHANNEL(channel)) {
221 DEBUG_LOG("new inputs channel");
222 }
223
224 if (SPICE_IS_PLAYBACK_CHANNEL(channel)) {
225 DEBUG_LOG("new audio channel");
226 if (self->audio != NULL)
227 return;
228 self->audio = spice_audio_new(s, NULL, NULL);
229 }
230 }
231
232 static void _spice_channel_destroy(G_GNUC_UNUSED SpiceSession *s, SpiceChannel *channel,
233 VirtViewerDisplay *display)
234 {
235 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
236 int id;
237
238 g_return_if_fail(self != NULL);
239
240 g_object_get(channel, "channel-id", &id, NULL);
241 if (SPICE_IS_MAIN_CHANNEL(channel)) {
242 DEBUG_LOG("zap main channel");
243 }
244
245 if (SPICE_IS_DISPLAY_CHANNEL(channel)) {
246 DEBUG_LOG("zap display channel (#%d)", id);
247 }
248
249 if (SPICE_IS_PLAYBACK_CHANNEL(channel)) {
250 if (self->audio == NULL)
251 return;
252 DEBUG_LOG("zap audio channel");
253 }
254 }
255
256 VirtViewerDisplaySpice* virt_viewer_display_spice_new(VirtViewer *viewer)
257 {
258 VirtViewerDisplaySpice *self;
259 VirtViewerDisplay *d;
260
261 g_return_val_if_fail(viewer != NULL, NULL);
262
263 self = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_SPICE, NULL);
264 d = VIRT_VIEWER_DISPLAY(self);
265 d->viewer = viewer;
266 d->need_align = FALSE;
267
268 self->session = spice_session_new();
269 g_signal_connect(self->session, "channel-new",
270 G_CALLBACK(_spice_channel_new), self);
271 g_signal_connect(self->session, "channel-destroy",
272 G_CALLBACK(_spice_channel_destroy), self);
273
274 return self;
275 }
276
277 /*
278 * Local variables:
279 * c-indent-level: 8
280 * c-basic-offset: 8
281 * tab-width: 8
282 * End:
283 */
+0
-78
src/display-spice.h less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #ifndef _VIRT_VIEWER_DISPLAY_SPICE_H
24 #define _VIRT_VIEWER_DISPLAY_SPICE_H
25
26 #include <glib-object.h>
27 #include <spice-widget.h>
28 #include <spice-audio.h>
29
30 #include "display.h"
31
32 G_BEGIN_DECLS
33
34 #define VIRT_VIEWER_TYPE_DISPLAY_SPICE virt_viewer_display_spice_get_type()
35
36 #define VIRT_VIEWER_DISPLAY_SPICE(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpice))
38
39 #define VIRT_VIEWER_DISPLAY_SPICE_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass))
41
42 #define VIRT_IS_VIEWER_DISPLAY_SPICE(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE))
44
45 #define VIRT_IS_VIEWER_DISPLAY_SPICE_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE))
47
48 #define VIRT_VIEWER_DISPLAY_SPICE_GET_CLASS(obj) \
49 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass))
50
51 typedef struct {
52 VirtViewerDisplay parent;
53
54 SpiceSession *session;
55 SpiceDisplay *display;
56 SpiceAudio *audio;
57 } VirtViewerDisplaySpice;
58
59 typedef struct {
60 VirtViewerDisplayClass parent_class;
61 } VirtViewerDisplaySpiceClass;
62
63 GType virt_viewer_display_spice_get_type(void);
64
65 VirtViewerDisplaySpice* virt_viewer_display_spice_new(VirtViewer *viewer);
66
67 G_END_DECLS
68
69 #endif /* _VIRT_VIEWER_DISPLAY_SPICE_H */
70
71 /*
72 * Local variables:
73 * c-indent-level: 8
74 * c-basic-offset: 8
75 * tab-width: 8
76 * End:
77 */
+0
-334
src/display-vnc.c less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23
24 #include "auth.h"
25 #include "display-vnc.h"
26
27 G_DEFINE_TYPE(VirtViewerDisplayVNC, virt_viewer_display_vnc, VIRT_VIEWER_TYPE_DISPLAY)
28
29 static void _vnc_close(VirtViewerDisplay* display);
30 static void _vnc_send_keys(VirtViewerDisplay* display, const guint *keyvals, int nkeyvals);
31 static GdkPixbuf* _vnc_get_pixbuf(VirtViewerDisplay* display);
32 static gboolean _vnc_open_fd(VirtViewerDisplay* display, int fd);
33 static gboolean _vnc_open_host(VirtViewerDisplay* display, char *host, char *port);
34 static gboolean _vnc_channel_open_fd(VirtViewerDisplay* display,
35 VirtViewerDisplayChannel* channel, int fd);
36
37 static void virt_viewer_display_vnc_class_init(VirtViewerDisplayVNCClass *klass)
38 {
39 VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass);
40
41 dclass->close = _vnc_close;
42 dclass->send_keys = _vnc_send_keys;
43 dclass->get_pixbuf = _vnc_get_pixbuf;
44 dclass->open_fd = _vnc_open_fd;
45 dclass->open_host = _vnc_open_host;
46 dclass->channel_open_fd = _vnc_channel_open_fd;
47 }
48
49 static void virt_viewer_display_vnc_init(VirtViewerDisplayVNC *self G_GNUC_UNUSED)
50 {
51 }
52
53 static void _vnc_mouse_grab(GtkWidget *vnc G_GNUC_UNUSED, VirtViewerDisplayVNC *self)
54 {
55 viewer_set_title(VIRT_VIEWER_DISPLAY(self)->viewer, TRUE);
56 }
57
58 static void _vnc_mouse_ungrab(GtkWidget *vnc G_GNUC_UNUSED, VirtViewerDisplayVNC *self)
59 {
60 viewer_set_title(VIRT_VIEWER_DISPLAY(self)->viewer, FALSE);
61 }
62
63 static void _vnc_key_grab(GtkWidget *vnc G_GNUC_UNUSED, VirtViewerDisplayVNC *self)
64 {
65 viewer_disable_modifiers(VIRT_VIEWER_DISPLAY(self)->viewer);
66 }
67
68 static void _vnc_key_ungrab(GtkWidget *vnc G_GNUC_UNUSED, VirtViewerDisplayVNC *self)
69 {
70 viewer_enable_modifiers(VIRT_VIEWER_DISPLAY(self)->viewer);
71 }
72
73 static void _vnc_send_keys(VirtViewerDisplay* display, const guint *keyvals, int nkeyvals)
74 {
75 VirtViewerDisplayVNC *self = VIRT_VIEWER_DISPLAY_VNC(display);
76
77 g_return_if_fail(self != NULL);
78 g_return_if_fail(keyvals != NULL);
79 g_return_if_fail(self->vnc != NULL);
80
81 vnc_display_send_keys(self->vnc, keyvals, nkeyvals);
82 }
83
84 static GdkPixbuf* _vnc_get_pixbuf(VirtViewerDisplay* display)
85 {
86 VirtViewerDisplayVNC *self = VIRT_VIEWER_DISPLAY_VNC(display);
87
88 g_return_val_if_fail(self != NULL, NULL);
89 g_return_val_if_fail(self->vnc != NULL, NULL);
90
91 return vnc_display_get_pixbuf(self->vnc);
92 }
93
94 static gboolean _vnc_open_fd(VirtViewerDisplay* display, int fd)
95 {
96 VirtViewerDisplayVNC *self = VIRT_VIEWER_DISPLAY_VNC(display);
97
98 g_return_val_if_fail(self != NULL, FALSE);
99 g_return_val_if_fail(self->vnc != NULL, FALSE);
100
101 return vnc_display_open_fd(self->vnc, fd);
102 }
103
104 static gboolean _vnc_channel_open_fd(VirtViewerDisplay* display G_GNUC_UNUSED,
105 VirtViewerDisplayChannel* channel G_GNUC_UNUSED,
106 int fd G_GNUC_UNUSED)
107 {
108 g_warning("channel_open_fd is not supported by VNC");
109 return FALSE;
110 }
111
112 static gboolean _vnc_open_host(VirtViewerDisplay* display, char *host, char *port)
113 {
114 VirtViewerDisplayVNC *self = VIRT_VIEWER_DISPLAY_VNC(display);
115
116 g_return_val_if_fail(self != NULL, FALSE);
117 g_return_val_if_fail(self->vnc != NULL, FALSE);
118
119 return vnc_display_open_host(self->vnc, host, port);
120 }
121
122 static void _vnc_close(VirtViewerDisplay* display)
123 {
124 VirtViewerDisplayVNC *self = VIRT_VIEWER_DISPLAY_VNC(display);
125
126 g_return_if_fail(self != NULL);
127
128 if (self->vnc != NULL)
129 vnc_display_close(self->vnc);
130 }
131
132 static void viewer_bell(VirtViewer *viewer, gpointer data G_GNUC_UNUSED)
133 {
134 gdk_window_beep(GTK_WIDGET(viewer->window)->window);
135 }
136
137 static void viewer_vnc_auth_unsupported(VirtViewer *viewer,
138 unsigned int authType, gpointer data G_GNUC_UNUSED)
139 {
140 viewer_simple_message_dialog(viewer->window,
141 _("Unable to authenticate with VNC server at %s\n"
142 "Unsupported authentication type %d"),
143 viewer->pretty_address, authType);
144 }
145
146 static void viewer_vnc_auth_failure(VirtViewer *viewer,
147 const char *reason, gpointer data G_GNUC_UNUSED)
148 {
149 GtkWidget *dialog;
150 int ret;
151
152 dialog = gtk_message_dialog_new(GTK_WINDOW(viewer->window),
153 GTK_DIALOG_MODAL |
154 GTK_DIALOG_DESTROY_WITH_PARENT,
155 GTK_MESSAGE_ERROR,
156 GTK_BUTTONS_YES_NO,
157 _("Unable to authenticate with VNC server at %s: %s\n"
158 "Retry connection again?"),
159 viewer->pretty_address, reason);
160
161 ret = gtk_dialog_run(GTK_DIALOG(dialog));
162
163 gtk_widget_destroy(dialog);
164
165 if (ret == GTK_RESPONSE_YES)
166 viewer->authretry = TRUE;
167 else
168 viewer->authretry = FALSE;
169 }
170
171 /*
172 * Triggers a resize of the main container to indirectly cause
173 * the display widget to be resized to fit the available space
174 */
175 static void
176 viewer_resize_display_widget(VirtViewer *viewer)
177 {
178 GtkWidget *align;
179 align = glade_xml_get_widget(viewer->glade, "display-align");
180 gtk_widget_queue_resize(align);
181 }
182
183
184 /*
185 * Called when desktop size changes.
186 *
187 * It either tries to resize the main window, or it triggers
188 * recalculation of the display within existing window size
189 */
190 static void viewer_resize_desktop(VirtViewer *viewer, gint width, gint height)
191 {
192 DEBUG_LOG("desktop resize %dx%d", width, height);
193 viewer->desktopWidth = width;
194 viewer->desktopHeight = height;
195
196 if (viewer->autoResize && viewer->window && !viewer->fullscreen) {
197 viewer_resize_main_window(viewer);
198 } else {
199 viewer_resize_display_widget(viewer);
200 }
201 }
202
203
204 /*
205 * Called when the main container widget's size has been set.
206 * It attempts to fit the display widget into this space while
207 * maintaining aspect ratio
208 */
209 static gboolean viewer_resize_align(GtkWidget *widget,
210 GtkAllocation *alloc,
211 VirtViewer *viewer)
212 {
213 double desktopAspect;
214 double scrollAspect;
215 int height, width;
216 GtkAllocation child;
217 int dx = 0, dy = 0;
218
219 if (!viewer->active) {
220 DEBUG_LOG("Skipping inactive resize");
221 return TRUE;
222 }
223
224 desktopAspect = (double)viewer->desktopWidth / (double)viewer->desktopHeight;
225 scrollAspect = (double)alloc->width / (double)alloc->height;
226
227 if (scrollAspect > desktopAspect) {
228 width = alloc->height * desktopAspect;
229 dx = (alloc->width - width) / 2;
230 height = alloc->height;
231 } else {
232 width = alloc->width;
233 height = alloc->width / desktopAspect;
234 dy = (alloc->height - height) / 2;
235 }
236
237 DEBUG_LOG("Align widget=%p is %dx%d, desktop is %dx%d, setting display to %dx%d",
238 widget,
239 alloc->width, alloc->height,
240 viewer->desktopWidth, viewer->desktopHeight,
241 width, height);
242
243 child.x = alloc->x + dx;
244 child.y = alloc->y + dy;
245 child.width = width;
246 child.height = height;
247 if (viewer->display && viewer->display->widget)
248 gtk_widget_size_allocate(viewer->display->widget, &child);
249
250 return FALSE;
251 }
252
253 VirtViewerDisplayVNC* virt_viewer_display_vnc_new(VirtViewer *viewer)
254 {
255 VirtViewerDisplayVNC *self;
256 VirtViewerDisplay *d;
257 GtkWidget *align;
258
259 g_return_val_if_fail(viewer != NULL, NULL);
260
261 self = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_VNC, NULL);
262 d = VIRT_VIEWER_DISPLAY(self);
263 d->viewer = viewer;
264 viewer->display = d;
265
266 d->need_align = TRUE;
267 d->widget = vnc_display_new();
268 self->vnc = VNC_DISPLAY(d->widget);
269 vnc_display_set_keyboard_grab(self->vnc, TRUE);
270 vnc_display_set_pointer_grab(self->vnc, TRUE);
271
272 /*
273 * In auto-resize mode we have things setup so that we always
274 * automatically resize the top level window to be exactly the
275 * same size as the VNC desktop, except when it won't fit on
276 * the local screen, at which point we let it scale down.
277 * The upshot is, we always want scaling enabled.
278 * We disable force_size because we want to allow user to
279 * manually size the widget smaller too
280 */
281 vnc_display_set_force_size(self->vnc, FALSE);
282 vnc_display_set_scaling(self->vnc, TRUE);
283
284 g_signal_connect_swapped(self->vnc, "vnc-connected",
285 G_CALLBACK(viewer_connected), viewer);
286 g_signal_connect_swapped(self->vnc, "vnc-initialized",
287 G_CALLBACK(viewer_initialized), viewer);
288 g_signal_connect_swapped(self->vnc, "vnc-disconnected",
289 G_CALLBACK(viewer_disconnected), viewer);
290
291 /* When VNC desktop resizes, we have to resize the containing widget */
292 g_signal_connect_swapped(self->vnc, "vnc-desktop-resize",
293 G_CALLBACK(viewer_resize_desktop), viewer);
294 g_signal_connect_swapped(self->vnc, "vnc-bell",
295 G_CALLBACK(viewer_bell), NULL);
296 g_signal_connect_swapped(self->vnc, "vnc-auth-failure",
297 G_CALLBACK(viewer_vnc_auth_failure), viewer);
298 g_signal_connect_swapped(self->vnc, "vnc-auth-unsupported",
299 G_CALLBACK(viewer_vnc_auth_unsupported), viewer);
300 g_signal_connect_swapped(self->vnc, "vnc-server-cut-text",
301 G_CALLBACK(viewer_server_cut_text), viewer);
302
303 g_signal_connect(self->vnc, "vnc-pointer-grab",
304 G_CALLBACK(_vnc_mouse_grab), self);
305 g_signal_connect(self->vnc, "vnc-pointer-ungrab",
306 G_CALLBACK(_vnc_mouse_ungrab), self);
307 g_signal_connect(self->vnc, "vnc-keyboard-grab",
308 G_CALLBACK(_vnc_key_grab), self);
309 g_signal_connect(self->vnc, "vnc-keyboard-ungrab",
310 G_CALLBACK(_vnc_key_ungrab), self);
311
312 g_signal_connect(self->vnc, "vnc-auth-credential",
313 G_CALLBACK(viewer_auth_vnc_credentials), &viewer->pretty_address);
314
315 viewer_add_display_and_realize(viewer);
316
317 align = glade_xml_get_widget(viewer->glade, "display-align");
318 g_signal_connect(align, "size-allocate",
319 G_CALLBACK(viewer_resize_align), viewer);
320
321 return self;
322 }
323
324
325
326
327 /*
328 * Local variables:
329 * c-indent-level: 8
330 * c-basic-offset: 8
331 * tab-width: 8
332 * End:
333 */
+0
-75
src/display-vnc.h less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #ifndef _VIRT_VIEWER_DISPLAY_VNC_H
24 #define _VIRT_VIEWER_DISPLAY_VNC_H
25
26 #include <glib-object.h>
27 #include <vncdisplay.h>
28
29 #include "display.h"
30
31 G_BEGIN_DECLS
32
33 #define VIRT_VIEWER_TYPE_DISPLAY_VNC virt_viewer_display_vnc_get_type()
34
35 #define VIRT_VIEWER_DISPLAY_VNC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVNC))
37
38 #define VIRT_VIEWER_DISPLAY_VNC_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVNCClass))
40
41 #define VIRT_IS_VIEWER_DISPLAY_VNC(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC))
43
44 #define VIRT_IS_VIEWER_DISPLAY_VNC_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC))
46
47 #define VIRT_VIEWER_DISPLAY_VNC_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVNCClass))
49
50 typedef struct {
51 VirtViewerDisplay parent;
52
53 VncDisplay *vnc;
54 } VirtViewerDisplayVNC;
55
56 typedef struct {
57 VirtViewerDisplayClass parent_class;
58 } VirtViewerDisplayVNCClass;
59
60 GType virt_viewer_display_vnc_get_type(void);
61
62 VirtViewerDisplayVNC* virt_viewer_display_vnc_new(VirtViewer *viewer);
63
64 G_END_DECLS
65
66 #endif /* _VIRT_VIEWER_DISPLAY_VNC_H */
67
68 /*
69 * Local variables:
70 * c-indent-level: 8
71 * c-basic-offset: 8
72 * tab-width: 8
73 * End:
74 */
+0
-90
src/display.c less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #include "display.h"
24
25 G_DEFINE_ABSTRACT_TYPE(VirtViewerDisplay, virt_viewer_display, G_TYPE_OBJECT)
26
27
28 static void virt_viewer_display_class_init(VirtViewerDisplayClass *klass G_GNUC_UNUSED)
29 {
30 }
31
32 static void virt_viewer_display_init(VirtViewerDisplay *self G_GNUC_UNUSED)
33 {
34 }
35
36 void virt_viewer_display_close(VirtViewerDisplay *self)
37 {
38 g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(self));
39
40 VIRT_VIEWER_DISPLAY_GET_CLASS(self)->close(self);
41 }
42
43 void virt_viewer_display_send_keys(VirtViewerDisplay *self,
44 const guint *keyvals, int nkeyvals)
45 {
46 g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(self));
47
48 VIRT_VIEWER_DISPLAY_GET_CLASS(self)->send_keys(self, keyvals, nkeyvals);
49 }
50
51 GdkPixbuf* virt_viewer_display_get_pixbuf(VirtViewerDisplay *self)
52 {
53 g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(self), NULL);
54
55 return VIRT_VIEWER_DISPLAY_GET_CLASS(self)->get_pixbuf(self);
56 }
57
58 gboolean virt_viewer_display_open_fd(VirtViewerDisplay *self, int fd)
59 {
60 g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(self), FALSE);
61
62 return VIRT_VIEWER_DISPLAY_GET_CLASS(self)->open_fd(self, fd);
63 }
64
65 gboolean virt_viewer_display_open_host(VirtViewerDisplay *self, char *host, char *port)
66 {
67 VirtViewerDisplayClass *klass;
68
69 g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(self), FALSE);
70
71 klass = VIRT_VIEWER_DISPLAY_GET_CLASS(self);
72 return klass->open_host(self, host, port);
73 }
74
75 gboolean virt_viewer_display_channel_open_fd(VirtViewerDisplay *self,
76 VirtViewerDisplayChannel *channel, int fd)
77 {
78 g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(self), FALSE);
79
80 return VIRT_VIEWER_DISPLAY_GET_CLASS(self)->channel_open_fd(self, channel, fd);
81 }
82
83 /*
84 * Local variables:
85 * c-indent-level: 8
86 * c-basic-offset: 8
87 * tab-width: 8
88 * End:
89 */
+0
-92
src/display.h less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #ifndef _VIRT_VIEWER_DISPLAY_H
24 #define _VIRT_VIEWER_DISPLAY_H
25
26 #include <glib-object.h>
27 #include "viewer-priv.h"
28
29 G_BEGIN_DECLS
30
31 #define VIRT_VIEWER_TYPE_DISPLAY virt_viewer_display_get_type()
32
33 #define VIRT_VIEWER_DISPLAY(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplay))
35
36 #define VIRT_VIEWER_DISPLAY_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass))
38
39 #define VIRT_VIEWER_IS_DISPLAY(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY))
41
42 #define VIRT_VIEWER_IS_DISPLAY_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY))
44
45 #define VIRT_VIEWER_DISPLAY_GET_CLASS(obj) \
46 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass))
47
48 /* perhaps this become an interface, and be pushed in gtkvnc and spice? */
49 struct _VirtViewerDisplay {
50 GObject parent;
51 gboolean need_align;
52 VirtViewer *viewer;
53 GtkWidget *widget;
54 };
55
56 struct _VirtViewerDisplayClass {
57 GObjectClass parent_class;
58
59 /* virtual methods */
60 void (* close) (VirtViewerDisplay* display);
61 void (* send_keys) (VirtViewerDisplay* display,
62 const guint *keyvals, int nkeyvals);
63 GdkPixbuf* (* get_pixbuf) (VirtViewerDisplay* display);
64 gboolean (* open_fd) (VirtViewerDisplay* display, int fd);
65 gboolean (* open_host) (VirtViewerDisplay* display, char *host, char *port);
66 gboolean (* channel_open_fd) (VirtViewerDisplay* display,
67 VirtViewerDisplayChannel* channel, int fd);
68 };
69
70 GType virt_viewer_display_get_type(void);
71
72 void virt_viewer_display_close(VirtViewerDisplay* display);
73 void virt_viewer_display_send_keys(VirtViewerDisplay* display,
74 const guint *keyvals, int nkeyvals);
75 GdkPixbuf* virt_viewer_display_get_pixbuf(VirtViewerDisplay* display);
76 gboolean virt_viewer_display_open_fd(VirtViewerDisplay* display, int fd);
77 gboolean virt_viewer_display_open_host(VirtViewerDisplay* display, char *host, char *port);
78 GObject* virt_viewer_display_get(VirtViewerDisplay* display);
79 gboolean virt_viewer_display_channel_open_fd(VirtViewerDisplay* display,
80 VirtViewerDisplayChannel* channel, int fd);
81
82 G_END_DECLS
83
84 #endif /* _VIRT_VIEWER_DISPLAY_H */
85 /*
86 * Local variables:
87 * c-indent-level: 8
88 * c-basic-offset: 8
89 * tab-width: 8
90 * End:
91 */
+0
-317
src/events.c less more
0 /*
1 * events.c: event loop integration
2 *
3 * Copyright (C) 2008-2009 Daniel P. Berrange
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22
23 #include <stdio.h>
24 #include <string.h>
25 #include <stdlib.h>
26 #include <glib.h>
27 #include <libvirt/libvirt.h>
28
29 #include "events.h"
30
31 struct viewer_event_handle
32 {
33 int watch;
34 int fd;
35 int events;
36 int enabled;
37 GIOChannel *channel;
38 guint source;
39 virEventHandleCallback cb;
40 void *opaque;
41 virFreeCallback ff;
42 };
43
44 static int nextwatch = 1;
45 static unsigned int nhandles = 0;
46 static struct viewer_event_handle **handles = NULL;
47
48 static gboolean
49 viewer_event_dispatch_handle(GIOChannel *source G_GNUC_UNUSED,
50 GIOCondition condition,
51 gpointer opaque)
52 {
53 struct viewer_event_handle *data = opaque;
54 int events = 0;
55
56 if (condition & G_IO_IN)
57 events |= VIR_EVENT_HANDLE_READABLE;
58 if (condition & G_IO_OUT)
59 events |= VIR_EVENT_HANDLE_WRITABLE;
60 if (condition & G_IO_HUP)
61 events |= VIR_EVENT_HANDLE_HANGUP;
62 if (condition & G_IO_ERR)
63 events |= VIR_EVENT_HANDLE_ERROR;
64
65 DEBUG_LOG("Dispatch handler %d %d %p\n", data->fd, events, data->opaque);
66
67 (data->cb)(data->watch, data->fd, events, data->opaque);
68
69 return TRUE;
70 }
71
72
73 static
74 int viewer_event_add_handle(int fd,
75 int events,
76 virEventHandleCallback cb,
77 void *opaque,
78 virFreeCallback ff)
79 {
80 struct viewer_event_handle *data;
81 GIOCondition cond = 0;
82
83 handles = g_realloc(handles, sizeof(*handles)*(nhandles+1));
84 data = g_malloc(sizeof(*data));
85 memset(data, 0, sizeof(*data));
86
87 if (events & VIR_EVENT_HANDLE_READABLE)
88 cond |= G_IO_IN;
89 if (events & VIR_EVENT_HANDLE_WRITABLE)
90 cond |= G_IO_OUT;
91
92 data->watch = nextwatch++;
93 data->fd = fd;
94 data->events = events;
95 data->cb = cb;
96 data->opaque = opaque;
97 data->channel = g_io_channel_unix_new(fd);
98 data->ff = ff;
99
100 DEBUG_LOG("Add handle %d %d %p\n", data->fd, events, data->opaque);
101
102 data->source = g_io_add_watch(data->channel,
103 cond,
104 viewer_event_dispatch_handle,
105 data);
106
107 handles[nhandles++] = data;
108
109 return data->watch;
110 }
111
112 static struct viewer_event_handle *
113 viewer_event_find_handle(int watch)
114 {
115 unsigned int i;
116 for (i = 0 ; i < nhandles ; i++)
117 if (handles[i]->watch == watch)
118 return handles[i];
119
120 return NULL;
121 }
122
123 static void
124 viewer_event_update_handle(int watch,
125 int events)
126 {
127 struct viewer_event_handle *data = viewer_event_find_handle(watch);
128
129 if (!data) {
130 DEBUG_LOG("Update for missing handle watch %d", watch);
131 return;
132 }
133
134 if (events) {
135 GIOCondition cond = 0;
136 if (events == data->events)
137 return;
138
139 if (data->source)
140 g_source_remove(data->source);
141
142 cond |= G_IO_HUP;
143 if (events & VIR_EVENT_HANDLE_READABLE)
144 cond |= G_IO_IN;
145 if (events & VIR_EVENT_HANDLE_WRITABLE)
146 cond |= G_IO_OUT;
147 data->source = g_io_add_watch(data->channel,
148 cond,
149 viewer_event_dispatch_handle,
150 data);
151 data->events = events;
152 } else {
153 if (!data->source)
154 return;
155
156 g_source_remove(data->source);
157 data->source = 0;
158 data->events = 0;
159 }
160 }
161
162 static int
163 viewer_event_remove_handle(int watch)
164 {
165 struct viewer_event_handle *data = viewer_event_find_handle(watch);
166
167 if (!data) {
168 DEBUG_LOG("Remove of missing watch %d", watch);
169 return -1;
170 }
171
172 DEBUG_LOG("Remove handle %d %d\n", watch, data->fd);
173
174 g_source_remove(data->source);
175 data->source = 0;
176 data->events = 0;
177 if (data->ff)
178 (data->ff)(data->opaque);
179 free(data);
180
181 return 0;
182 }
183
184 struct viewer_event_timeout
185 {
186 int timer;
187 int interval;
188 guint source;
189 virEventTimeoutCallback cb;
190 void *opaque;
191 virFreeCallback ff;
192 };
193
194
195 static int nexttimer = 1;
196 static unsigned int ntimeouts = 0;
197 static struct viewer_event_timeout **timeouts = NULL;
198
199 static gboolean
200 viewer_event_dispatch_timeout(void *opaque)
201 {
202 struct viewer_event_timeout *data = opaque;
203 DEBUG_LOG("Dispatch timeout %p %p %d %p\n", data, data->cb, data->timer, data->opaque);
204 (data->cb)(data->timer, data->opaque);
205
206 return TRUE;
207 }
208
209 static int
210 viewer_event_add_timeout(int interval,
211 virEventTimeoutCallback cb,
212 void *opaque,
213 virFreeCallback ff)
214 {
215 struct viewer_event_timeout *data;
216
217 timeouts = g_realloc(timeouts, sizeof(*timeouts)*(ntimeouts+1));
218 data = g_malloc(sizeof(*data));
219 memset(data, 0, sizeof(*data));
220
221 data->timer = nexttimer++;
222 data->interval = interval;
223 data->cb = cb;
224 data->opaque = opaque;
225 data->ff = ff;
226 if (interval >= 0)
227 data->source = g_timeout_add(interval,
228 viewer_event_dispatch_timeout,
229 data);
230
231 timeouts[ntimeouts++] = data;
232
233 DEBUG_LOG("Add timeout %p %d %p %p %d\n", data, interval, cb, opaque, data->timer);
234
235 return data->timer;
236 }
237
238
239 static struct viewer_event_timeout *
240 viewer_event_find_timeout(int timer)
241 {
242 unsigned int i;
243 for (i = 0 ; i < ntimeouts ; i++)
244 if (timeouts[i]->timer == timer)
245 return timeouts[i];
246
247 return NULL;
248 }
249
250
251 static void
252 viewer_event_update_timeout(int timer,
253 int interval)
254 {
255 struct viewer_event_timeout *data = viewer_event_find_timeout(timer);
256
257 if (!data) {
258 DEBUG_LOG("Update of missing timer %d", timer);
259 return;
260 }
261
262 DEBUG_LOG("Update timeout %p %d %d\n", data, timer, interval);
263
264 if (interval >= 0) {
265 if (data->source)
266 return;
267
268 data->interval = interval;
269 data->source = g_timeout_add(data->interval,
270 viewer_event_dispatch_timeout,
271 data);
272 } else {
273 if (!data->source)
274 return;
275
276 g_source_remove(data->source);
277 data->source = 0;
278 }
279 }
280
281 static int
282 viewer_event_remove_timeout(int timer)
283 {
284 struct viewer_event_timeout *data = viewer_event_find_timeout(timer);
285
286 if (!data) {
287 DEBUG_LOG("Remove of missing timer %d", timer);
288 return -1;
289 }
290
291 DEBUG_LOG("Remove timeout %p %d\n", data, timer);
292
293 if (!data->source)
294 return -1;
295
296 g_source_remove(data->source);
297 data->source = 0;
298
299 if (data->ff)
300 (data->ff)(data->opaque);
301
302 free(data);
303
304 return 0;
305 }
306
307
308 void viewer_event_register(void) {
309 virEventRegisterImpl(viewer_event_add_handle,
310 viewer_event_update_handle,
311 viewer_event_remove_handle,
312 viewer_event_add_timeout,
313 viewer_event_update_timeout,
314 viewer_event_remove_timeout);
315 }
316
+0
-30
src/events.h less more
0 /*
1 * events.h: event loop integration
2 *
3 * Copyright (C) 2008-2009 Daniel P. Berrange
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #ifndef VIRT_VIEWER_EVENT_H
23 #define VIRT_VIEWER_EVENT_H
24
25 #include "util.h"
26
27 void viewer_event_register(void);
28
29 #endif
+0
-122
src/main.c less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007 Red Hat,
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #include <config.h>
23 #include <locale.h>
24 #include <vncdisplay.h>
25 #include <gtk/gtk.h>
26 #include <glib/gi18n.h>
27 #include <stdlib.h>
28
29 #include "viewer.h"
30
31 static void viewer_version(void)
32 {
33 g_print(_("%s version %s\n"), PACKAGE, VERSION);
34
35 exit(0);
36 }
37
38
39 int main(int argc, char **argv)
40 {
41 GOptionContext *context;
42 GError *error = NULL;
43 int ret;
44 char *uri = NULL;
45 int zoom = 100;
46 gchar **args = NULL;
47 gboolean verbose = FALSE;
48 gboolean debug = FALSE;
49 gboolean direct = FALSE;
50 gboolean waitvm = FALSE;
51 gboolean reconnect = FALSE;
52 const char *help_msg = N_("Run '" PACKAGE " --help' to see a full list of available command line options");
53 const GOptionEntry options [] = {
54 { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
55 viewer_version, N_("display version information"), NULL },
56 { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
57 N_("display verbose information"), NULL },
58 { "direct", 'd', 0, G_OPTION_ARG_NONE, &direct,
59 N_("direct connection with no automatic tunnels"), NULL },
60 { "connect", 'c', 0, G_OPTION_ARG_STRING, &uri,
61 N_("connect to hypervisor"), "URI"},
62 { "wait", 'w', 0, G_OPTION_ARG_NONE, &waitvm,
63 N_("wait for domain to start"), NULL },
64 { "reconnect", 'r', 0, G_OPTION_ARG_NONE, &reconnect,
65 N_("reconnect to domain upon restart"), NULL },
66 { "zoom", 'z', 0, G_OPTION_ARG_INT, &zoom,
67 N_("Zoom level of window, in percentage"), "ZOOM" },
68 { "debug", '\0', 0, G_OPTION_ARG_NONE, &debug,
69 N_("display debugging information"), NULL },
70 { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args,
71 NULL, "DOMAIN-NAME|ID|UUID" },
72 { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
73 };
74
75 setlocale(LC_ALL, "");
76 bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
77 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
78 textdomain(GETTEXT_PACKAGE);
79
80 /* Setup command line options */
81 context = g_option_context_new (_("- Virtual machine graphical console"));
82 g_option_context_add_main_entries (context, options, NULL);
83 g_option_context_add_group (context, gtk_get_option_group (TRUE));
84 g_option_context_add_group (context, vnc_display_get_option_group ());
85 g_option_context_parse (context, &argc, &argv, &error);
86 if (error) {
87 g_printerr("%s\n%s\n",
88 error->message,
89 gettext(help_msg));
90 g_error_free(error);
91 return 1;
92 }
93
94 g_option_context_free(context);
95
96 if (!args || (g_strv_length(args) != 1)) {
97 fprintf(stderr, _("\nUsage: %s [OPTIONS] DOMAIN-NAME|ID|UUID\n\n%s\n\n"), argv[0], help_msg);
98 return 1;
99 }
100
101 if (zoom < 10 || zoom > 200) {
102 fprintf(stderr, "Zoom level must be within 10-200\n");
103 return 1;
104 }
105
106 ret = viewer_start (uri, args[0], zoom, direct, waitvm, reconnect, verbose, debug, NULL);
107 if (ret != 0)
108 return ret;
109
110 gtk_main();
111
112 return 0;
113 }
114
115 /*
116 * Local variables:
117 * c-indent-level: 8
118 * c-basic-offset: 8
119 * tab-width: 8
120 * End:
121 */
+0
-46
src/util.c less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Author: Daniel P. Berrange <berrange@redhat.com>
21 */
22
23 #include <config.h>
24
25 #include <sys/types.h>
26 #include <sys/stat.h>
27 #include <unistd.h>
28
29 #include "util.h"
30
31 GladeXML *viewer_load_glade(const char *name, const char *widget)
32 {
33 char *path;
34 struct stat sb;
35 GladeXML *xml;
36
37 if (stat(name, &sb) >= 0)
38 return glade_xml_new(name, widget, NULL);
39
40 path = g_strdup_printf("%s/%s", GLADE_DIR, name);
41
42 xml = glade_xml_new(path, widget, NULL);
43 g_free(path);
44 return xml;
45 }
+0
-42
src/util.h less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Author: Daniel P. Berrange <berrange@redhat.com>
21 */
22
23 #ifndef VIRT_VIEWER_UTIL_H
24 #define VIRT_VIEWER_UTIL_H
25
26 #include <gtk/gtk.h>
27 #include <glade/glade.h>
28
29 #if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION <= 12)
30 #define gtk_widget_get_window(widget) ((widget)->window)
31 #endif
32
33 extern gboolean doDebug;
34
35 #define DEBUG_LOG(s, ...) do { if (doDebug) g_debug((s), ## __VA_ARGS__); } while (0)
36 #define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
37
38
39 GladeXML *viewer_load_glade(const char *name, const char *widget);
40
41 #endif
0 /* *************************************************************************
1 * Copyright (c) 2005 VMware Inc.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining
4 * a copy of this software and associated documentation files (the
5 * "Software"), to deal in the Software without restriction, including
6 * without limitation the rights to use, copy, modify, merge, publish,
7 * distribute, sublicense, and/or sell copies of the Software, and to
8 * permit persons to whom the Software is furnished to do so, subject to
9 * the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 * *************************************************************************/
22
23 /*
24 * autoDrawer.c -
25 *
26 * Subclass of ViewDrawer that encapsulates the behaviour typically required
27 * when using the drawer to implement a menu/toolbar that auto-opens when
28 * moused-over and auto-closes when the mouse leaves.
29 */
30
31
32 #include "autoDrawer.h"
33
34
35 struct _ViewAutoDrawerPrivate
36 {
37 gboolean active;
38 gboolean pinned;
39 gboolean inputUngrabbed;
40
41 gboolean opened;
42 gboolean forceClosing;
43
44 gboolean fill;
45 gint offset;
46
47 guint closeConnection;
48 guint delayConnection;
49 guint delayValue;
50 guint overlapPixels;
51 guint noOverlapPixels;
52
53 GtkWidget *over;
54 GtkWidget *evBox;
55 };
56
57 #define VIEW_AUTODRAWER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), VIEW_TYPE_AUTODRAWER, ViewAutoDrawerPrivate))
58
59 /* The unaltered parent class. */
60 static ViewDrawerClass *parentClass;
61
62
63 /*
64 *-----------------------------------------------------------------------------
65 *
66 * ViewAutoDrawerEnforce --
67 *
68 * Enforce an AutoDrawer's goal now.
69 *
70 * Results:
71 * None
72 *
73 * Side effects:
74 * None
75 *
76 *-----------------------------------------------------------------------------
77 */
78
79 static void
80 ViewAutoDrawerEnforce(ViewAutoDrawer *that, // IN
81 gboolean animate) // IN
82 {
83 double fraction;
84 GtkAllocation allocation;
85 ViewAutoDrawerPrivate *priv = that->priv;
86
87 if (!priv->active) {
88 ViewOvBox_SetMin(VIEW_OV_BOX(that), -1);
89 ViewOvBox_SetFraction(VIEW_OV_BOX(that), 0);
90 return;
91 }
92
93 g_assert(priv->over != NULL);
94 g_assert(GTK_IS_WIDGET(priv->over));
95
96 ViewOvBox_SetMin(VIEW_OV_BOX(that), priv->noOverlapPixels);
97
98 // The forceClosing flag overrides the opened flag.
99 if (priv->opened && !priv->forceClosing) {
100 fraction = 1;
101 } else {
102 gtk_widget_get_allocation (priv->over, &allocation);
103 fraction = ((double)priv->overlapPixels / allocation.height);
104 }
105
106 if (!animate) {
107 ViewOvBox_SetFraction(VIEW_OV_BOX(that), fraction);
108 }
109 ViewDrawer_SetGoal(VIEW_DRAWER(that), fraction);
110 }
111
112
113 /*
114 *-----------------------------------------------------------------------------
115 *
116 * ViewAutoDrawerOnEnforceDelay --
117 *
118 * Callback fired when a delayed update happens to update the drawer state.
119 *
120 * Results:
121 * FALSE to indicate timer should not repeat.
122 *
123 * Side effects:
124 * None
125 *
126 *-----------------------------------------------------------------------------
127 */
128
129 static gboolean
130 ViewAutoDrawerOnEnforceDelay(ViewAutoDrawer *that) // IN
131 {
132 that->priv->delayConnection = 0;
133 ViewAutoDrawerEnforce(that, TRUE);
134
135 return FALSE;
136 }
137
138
139 /*
140 *-----------------------------------------------------------------------------
141 *
142 * ViewAutoDrawerOnCloseDelay --
143 *
144 * Callback fired when the drawer is closed manually. This prevents the
145 * drawer from reopening right away.
146 *
147 * Results:
148 * FALSE to indicate timer should not repeat.
149 *
150 * Side effects:
151 * None
152 *
153 *-----------------------------------------------------------------------------
154 */
155
156 static gboolean
157 ViewAutoDrawerOnCloseDelay(ViewAutoDrawer *that) // IN
158 {
159 that->priv->closeConnection = 0;
160 that->priv->forceClosing = FALSE;
161
162 return FALSE;
163 }
164
165
166 /*
167 *-----------------------------------------------------------------------------
168 *
169 * ViewAutoDrawerUpdate --
170 *
171 * Decide whether an AutoDrawer should be opened or closed, and enforce
172 * that decision now or later.
173 *
174 * Results:
175 * None
176 *
177 * Side effects:
178 * None
179 *
180 *-----------------------------------------------------------------------------
181 */
182
183 static void
184 ViewAutoDrawerUpdate(ViewAutoDrawer *that, // IN
185 gboolean immediate) // IN
186 {
187 ViewAutoDrawerPrivate *priv = that->priv;
188 GtkWidget *toplevel = gtk_widget_get_toplevel(GTK_WIDGET(that));
189 GtkWindow *window;
190 GtkAllocation allocation;
191
192 if (!toplevel || !gtk_widget_is_toplevel(toplevel)) {
193 // The autoDrawer cannot function properly without a toplevel.
194 return;
195 }
196 window = GTK_WINDOW(toplevel);
197
198 /*
199 * We decide to open the drawer by OR'ing several conditions. Evaluating a
200 * condition can have the side-effect of setting 'immediate' to TRUE, so we
201 * cannot stop evaluating the conditions after we have found one to be TRUE.
202 */
203
204 priv->opened = FALSE;
205
206 /* Is the AutoDrawer pinned? */
207
208 if (priv->pinned) {
209 immediate = TRUE;
210
211 priv->opened = TRUE;
212 }
213
214 /* Is the mouse cursor inside the event box? */
215
216 {
217 int x;
218 int y;
219
220 gtk_widget_get_pointer(priv->evBox, &x, &y);
221 gtk_widget_get_allocation(priv->evBox, &allocation);
222 g_assert(gtk_container_get_border_width( GTK_CONTAINER(priv->evBox))
223 == 0);
224 if ( (guint)x < (guint)allocation.width
225 && (guint)y < (guint)allocation.height) {
226 priv->opened = TRUE;
227 }
228 }
229
230 /* If there is a focused widget, is it inside the event box? */
231
232 {
233 GtkWidget *focus;
234
235 focus = gtk_window_get_focus(window);
236 if (focus && gtk_widget_is_ancestor(focus, priv->evBox)) {
237 /*
238 * Override the default 'immediate' to make sure the 'over' widget
239 * immediately appears along with the widget the focused widget.
240 */
241 immediate = TRUE;
242
243 priv->opened = TRUE;
244 }
245 }
246
247 /* If input is grabbed, is it on behalf of a widget inside the event box? */
248
249 if (!priv->inputUngrabbed) {
250 GtkWidget *grabbed = NULL;
251
252 #if GTK_CHECK_VERSION(3, 0, 0)
253 if (gtk_window_has_group (window)) {
254 GtkWindowGroup *group = gtk_window_get_group (window);
255 grabbed = gtk_window_group_get_current_grab (group);
256 }
257 #else
258 if (window->group && window->group->grabs) {
259 grabbed = GTK_WIDGET(window->group->grabs->data);
260 }
261 #endif
262 if (!grabbed) {
263 grabbed = gtk_grab_get_current();
264 }
265
266 if (grabbed && GTK_IS_MENU(grabbed)) {
267 /*
268 * With cascading menus, the deepest menu owns the grab. Traverse the
269 * menu hierarchy up until we reach the attach widget for the whole
270 * hierarchy.
271 */
272
273 for (;;) {
274 GtkWidget *menuAttach;
275 GtkWidget *menuItemParent;
276
277 menuAttach = gtk_menu_get_attach_widget(GTK_MENU(grabbed));
278 if (!menuAttach) {
279 /*
280 * It is unfortunately not mandatory for a menu to have a proper
281 * attach widget set.
282 */
283 break;
284 }
285
286 grabbed = menuAttach;
287 if (!GTK_IS_MENU_ITEM(grabbed)) {
288 break;
289 }
290
291 menuItemParent = gtk_widget_get_parent(grabbed);
292 g_return_if_fail(menuItemParent);
293 if (!GTK_IS_MENU(menuItemParent)) {
294 break;
295 }
296
297 grabbed = menuItemParent;
298 }
299 }
300
301 if (grabbed && gtk_widget_is_ancestor(grabbed, priv->evBox)) {
302 /*
303 * Override the default 'immediate' to make sure the 'over' widget
304 * immediately appears along with the widget the grab happens on
305 * behalf of.
306 */
307 immediate = TRUE;
308
309 priv->opened = TRUE;
310 }
311 }
312
313 if (priv->delayConnection) {
314 g_source_remove(priv->delayConnection);
315 }
316
317 if (priv->forceClosing) {
318 ViewAutoDrawerEnforce(that, TRUE);
319 } else if (immediate) {
320 ViewAutoDrawerEnforce(that, FALSE);
321 } else {
322 priv->delayConnection = g_timeout_add(priv->delayValue,
323 (GSourceFunc)ViewAutoDrawerOnEnforceDelay, that);
324 }
325 }
326
327
328 /*
329 *-----------------------------------------------------------------------------
330 *
331 * ViewAutoDrawerOnOverEnterLeave --
332 *
333 * Respond to enter/leave events by doing a delayed update of the drawer
334 * state.
335 *
336 * Results:
337 * FALSE to indicate event was not handled.
338 *
339 * Side effects:
340 * Will queue delayed update.
341 *
342 *-----------------------------------------------------------------------------
343 */
344
345 static gboolean
346 ViewAutoDrawerOnOverEnterLeave(GtkWidget *evBox G_GNUC_UNUSED, // IN: Unused
347 GdkEventCrossing *event G_GNUC_UNUSED, // IN
348 ViewAutoDrawer *that) // IN
349 {
350 /*
351 * This change happens in response to user input. By default, give the user
352 * some time to correct his input before reacting to the change.
353 */
354 ViewAutoDrawerUpdate(that, FALSE);
355
356 return FALSE;
357 }
358
359
360 /*
361 *-----------------------------------------------------------------------------
362 *
363 * ViewAutoDrawerOnGrabNotify --
364 *
365 * Respond to grab notifications by updating the drawer state.
366 *
367 * Results:
368 * None
369 *
370 * Side effects:
371 * Might queue delayed update.
372 *
373 *-----------------------------------------------------------------------------
374 */
375
376 static void
377 ViewAutoDrawerOnGrabNotify(GtkWidget *evBox G_GNUC_UNUSED, // IN: Unused
378 gboolean ungrabbed, // IN
379 ViewAutoDrawer *that) // IN
380 {
381 ViewAutoDrawerPrivate *priv = that->priv;
382
383 priv->inputUngrabbed = ungrabbed;
384
385 /*
386 * This change happens in response to user input. By default, give the user
387 * some time to correct his input before reacting to the change.
388 */
389 ViewAutoDrawerUpdate(that, FALSE);
390 }
391
392
393 /*
394 *-----------------------------------------------------------------------------
395 *
396 * ViewAutoDrawerOnSetFocus --
397 *
398 * Respond to changes in the focus widget of the autoDrawer's toplevel
399 * by recalculating the state.
400 *
401 * Results:
402 * None
403 *
404 * Side effects:
405 * Drawer state is updated.
406 *
407 *-----------------------------------------------------------------------------
408 */
409
410 static void
411 ViewAutoDrawerOnSetFocus(GtkWindow *window G_GNUC_UNUSED, // IN
412 GtkWidget *widget G_GNUC_UNUSED, // IN
413 ViewAutoDrawer *that) // IN
414 {
415 /*
416 * This change happens in response to user input. By default, give the user
417 * some time to correct his input before reacting to the change.
418 */
419 ViewAutoDrawerUpdate(that, FALSE);
420 }
421
422
423 /*
424 *-----------------------------------------------------------------------------
425 *
426 * ViewAutoDrawerOnHierarchyChanged --
427 *
428 * Respond to changes in the toplevel for the AutoDrawer. A toplevel is
429 * required for the AutoDrawer to calculate its state.
430 *
431 * Results:
432 * None
433 *
434 * Side effects:
435 * Drawer state is updated.
436 *
437 *-----------------------------------------------------------------------------
438 */
439
440 static void
441 ViewAutoDrawerOnHierarchyChanged(ViewAutoDrawer *that, // IN
442 GtkWidget *oldToplevel) // IN
443 {
444 GtkWidget *newToplevel = gtk_widget_get_toplevel(GTK_WIDGET(that));
445
446 if (oldToplevel && gtk_widget_is_toplevel(oldToplevel)) {
447 g_signal_handlers_disconnect_by_func(oldToplevel,
448 G_CALLBACK(ViewAutoDrawerOnSetFocus),
449 that);
450 }
451
452 if (newToplevel && gtk_widget_is_toplevel(newToplevel)) {
453 g_signal_connect_after(newToplevel, "set-focus",
454 G_CALLBACK(ViewAutoDrawerOnSetFocus), that);
455 }
456
457 /* This change happens programmatically. Always react to it immediately. */
458 ViewAutoDrawerUpdate(that, TRUE);
459 }
460
461
462 /*
463 *-----------------------------------------------------------------------------
464 *
465 * ViewAutoDrawerSetOver --
466 *
467 * Virtual method override so that the user's over widget is placed
468 * inside the AutoDrawer's event box.
469 *
470 * Results:
471 * None
472 *
473 * Side effects:
474 * None
475 *
476 *-----------------------------------------------------------------------------
477 */
478
479 static void
480 ViewAutoDrawerSetOver(ViewOvBox *ovBox, // IN
481 GtkWidget *widget) // IN
482 {
483 ViewAutoDrawer *that = VIEW_AUTODRAWER(ovBox);
484 ViewAutoDrawerPrivate *priv = that->priv;
485 GtkWidget *oldChild = gtk_bin_get_child(GTK_BIN(priv->evBox));
486
487 if (oldChild) {
488 g_object_ref(oldChild);
489 gtk_container_remove(GTK_CONTAINER(priv->evBox), oldChild);
490 }
491
492 if (widget) {
493 gtk_container_add(GTK_CONTAINER(priv->evBox), widget);
494 }
495
496 if (oldChild) {
497 g_object_unref(oldChild);
498 }
499
500 priv->over = widget;
501 }
502
503
504 /*
505 *-----------------------------------------------------------------------------
506 *
507 * ViewAutoDrawerRefreshPacking --
508 *
509 * Sets the actual packing values for fill, expand, and packing
510 * given internal settings.
511 *
512 * Results:
513 * None
514 *
515 * Side effects:
516 * Drawer state is updated.
517 *
518 *-----------------------------------------------------------------------------
519 */
520
521 static void
522 ViewAutoDrawerRefreshPacking(ViewAutoDrawer *that) // IN
523 {
524 gboolean expand;
525 gboolean fill;
526 guint padding;
527
528 expand = (that->priv->fill || (that->priv->offset < 0));
529 fill = that->priv->fill;
530 padding = (expand || fill) ? 0 : that->priv->offset;
531
532 gtk_box_set_child_packing(GTK_BOX(that), that->priv->evBox,
533 expand, fill, padding, GTK_PACK_START);
534 }
535
536
537 /*
538 *-----------------------------------------------------------------------------
539 *
540 * ViewAutoDrawerInit --
541 *
542 * Initialize a ViewAutoDrawer.
543 *
544 * Results:
545 * None
546 *
547 * Side effects:
548 * None
549 *
550 *-----------------------------------------------------------------------------
551 */
552
553 static void
554 ViewAutoDrawerInit(GTypeInstance *instance, // IN
555 gpointer klass G_GNUC_UNUSED) // Unused
556 {
557 ViewAutoDrawer *that;
558 ViewAutoDrawerPrivate *priv;
559
560 that = VIEW_AUTODRAWER(instance);
561 that->priv = VIEW_AUTODRAWER_GET_PRIVATE(that);
562 priv = that->priv;
563
564 priv->active = TRUE;
565 priv->pinned = FALSE;
566 priv->forceClosing = FALSE;
567 priv->inputUngrabbed = TRUE;
568 priv->delayConnection = 0;
569 priv->delayValue = 250;
570 priv->overlapPixels = 0;
571 priv->noOverlapPixels = 1;
572
573 priv->fill = TRUE;
574 priv->offset = -1;
575
576 priv->evBox = gtk_event_box_new();
577 gtk_widget_show(priv->evBox);
578 VIEW_OV_BOX_CLASS(parentClass)->set_over(VIEW_OV_BOX(that), priv->evBox);
579
580 g_signal_connect(priv->evBox, "enter-notify-event",
581 G_CALLBACK(ViewAutoDrawerOnOverEnterLeave), that);
582 g_signal_connect(priv->evBox, "leave-notify-event",
583 G_CALLBACK(ViewAutoDrawerOnOverEnterLeave), that);
584 g_signal_connect(priv->evBox, "grab-notify",
585 G_CALLBACK(ViewAutoDrawerOnGrabNotify), that);
586
587 g_signal_connect(that, "hierarchy-changed",
588 G_CALLBACK(ViewAutoDrawerOnHierarchyChanged), NULL);
589
590 /* This change happens programmatically. Always react to it immediately. */
591 ViewAutoDrawerUpdate(that, TRUE);
592
593 ViewAutoDrawerRefreshPacking(that);
594 }
595
596
597 /*
598 *-----------------------------------------------------------------------------
599 *
600 * ViewAutoDrawerFinalize --
601 *
602 * "finalize" method of a ViewAutoDrawer.
603 *
604 * Results:
605 * None
606 *
607 * Side effects:
608 * None
609 *
610 *-----------------------------------------------------------------------------
611 */
612
613 static void
614 ViewAutoDrawerFinalize(GObject *object) // IN
615 {
616 ViewAutoDrawer *that;
617
618 that = VIEW_AUTODRAWER(object);
619 if (that->priv->delayConnection) {
620 g_source_remove(that->priv->delayConnection);
621 }
622
623 G_OBJECT_CLASS(parentClass)->finalize(object);
624 }
625
626
627 /*
628 *-----------------------------------------------------------------------------
629 *
630 * ViewAutoDrawerClassInit --
631 *
632 * Initialize the ViewAutoDrawerClass.
633 *
634 * Results:
635 * None
636 *
637 * Side effects:
638 * None
639 *
640 *-----------------------------------------------------------------------------
641 */
642
643 static void
644 ViewAutoDrawerClassInit(gpointer klass) // IN
645 {
646 GObjectClass *objectClass = G_OBJECT_CLASS(klass);
647 ViewOvBoxClass *ovBoxClass = VIEW_OV_BOX_CLASS(klass);
648
649 parentClass = g_type_class_peek_parent(klass);
650
651 objectClass->finalize = ViewAutoDrawerFinalize;
652
653 ovBoxClass->set_over = ViewAutoDrawerSetOver;
654
655 g_type_class_add_private(objectClass, sizeof(ViewAutoDrawerPrivate));
656 }
657
658
659 /*
660 *-----------------------------------------------------------------------------
661 *
662 * ViewAutoDrawer_GetType --
663 *
664 * Get the (memoized) GType of the ViewAutoDrawer GTK+ object.
665 *
666 * Results:
667 * The GType
668 *
669 * Side effects:
670 * None
671 *
672 *-----------------------------------------------------------------------------
673 */
674
675 GType
676 ViewAutoDrawer_GetType(void)
677 {
678 static GType type = 0;
679
680 if (type == 0) {
681 static const GTypeInfo info = {
682 sizeof (ViewAutoDrawerClass),
683 NULL, /* BaseInit */
684 NULL, /* BaseFinalize */
685 (GClassInitFunc)ViewAutoDrawerClassInit,
686 NULL,
687 NULL, /* Class Data */
688 sizeof (ViewAutoDrawer),
689 0, /* n_preallocs */
690 (GInstanceInitFunc)ViewAutoDrawerInit,
691 NULL,
692 };
693
694 type = g_type_register_static(VIEW_TYPE_DRAWER, "ViewAutoDrawer", &info, 0);
695 }
696
697 return type;
698 }
699
700
701 /*
702 *-----------------------------------------------------------------------------
703 *
704 * ViewAutoDrawer_New --
705 *
706 * Create a new ViewAutoDrawer GTK+ widget.
707 *
708 * Results:
709 * The widget
710 *
711 * Side effects:
712 * None
713 *
714 *-----------------------------------------------------------------------------
715 */
716
717 GtkWidget *
718 ViewAutoDrawer_New(void)
719 {
720 return GTK_WIDGET(g_object_new(VIEW_TYPE_AUTODRAWER, NULL));
721 }
722
723
724 /*
725 *-----------------------------------------------------------------------------
726 *
727 * ViewAutoDrawer_SetSlideDelay --
728 *
729 * Set the response time of an AutoDrawer in ms., i.e. the time that
730 * elapses between:
731 * - when the AutoDrawer notices a change that can impact the outcome of
732 * the decision to open or close the drawer,
733 * and
734 * - when the AutoDrawer makes such decision.
735 *
736 * Users move the mouse inaccurately. If they temporarily move the mouse in
737 * or out of the AutoDrawer for less than the reponse time, their move will
738 * be ignored.
739 *
740 * Results:
741 * None
742 *
743 * Side effects:
744 * None
745 *
746 *-----------------------------------------------------------------------------
747 */
748
749 void
750 ViewAutoDrawer_SetSlideDelay(ViewAutoDrawer *that, // IN
751 guint delay) // IN
752 {
753 g_return_if_fail(VIEW_IS_AUTODRAWER(that));
754
755 that->priv->delayValue = delay;
756 }
757
758
759 /*
760 *-----------------------------------------------------------------------------
761 *
762 * ViewAutoDrawer_SetOverlapPixels --
763 *
764 * Set the number of pixels that the over widget overlaps the under widget
765 * when not open.
766 *
767 * Results:
768 * None
769 *
770 * Side effects:
771 * Drawer state is updated.
772 *
773 *-----------------------------------------------------------------------------
774 */
775
776 void
777 ViewAutoDrawer_SetOverlapPixels(ViewAutoDrawer *that, // IN
778 guint overlapPixels) // IN
779 {
780 g_return_if_fail(VIEW_IS_AUTODRAWER(that));
781
782 that->priv->overlapPixels = overlapPixels;
783
784 /* This change happens programmatically. Always react to it immediately. */
785 ViewAutoDrawerUpdate(that, TRUE);
786 }
787
788
789 /*
790 *-----------------------------------------------------------------------------
791 *
792 * ViewAutoDrawer_SetNoOverlapPixels --
793 *
794 * Set the number of pixels that the drawer reserves when not open. The
795 * over widget does not overlap the under widget over these pixels.
796 *
797 * Results:
798 * None
799 *
800 * Side effects:
801 * Drawer state is updated.
802 *
803 *-----------------------------------------------------------------------------
804 */
805
806 void
807 ViewAutoDrawer_SetNoOverlapPixels(ViewAutoDrawer *that, // IN
808 guint noOverlapPixels) // IN
809 {
810 g_return_if_fail(VIEW_IS_AUTODRAWER(that));
811
812 that->priv->noOverlapPixels = noOverlapPixels;
813
814 /* This change happens programmatically. Always react to it immediately. */
815 ViewAutoDrawerUpdate(that, TRUE);
816 }
817
818
819 /*
820 *-----------------------------------------------------------------------------
821 *
822 * ViewAutoDrawer_SetActive --
823 *
824 * Set whether the AutoDrawer is active or not. That is to say, whether
825 * it is acting as a drawer or not. When inactive, the over and under
826 * widget do not overlap and the net result is very much like a vbox.
827 *
828 * Results:
829 * None
830 *
831 * Side effects:
832 * Drawer state is updated.
833 *
834 *-----------------------------------------------------------------------------
835 */
836
837 void
838 ViewAutoDrawer_SetActive(ViewAutoDrawer *that, // IN
839 gboolean active) // IN
840 {
841 g_return_if_fail(VIEW_IS_AUTODRAWER(that));
842
843 that->priv->active = active;
844
845 /* This change happens programmatically. Always react to it immediately. */
846 ViewAutoDrawerUpdate(that, TRUE);
847 }
848
849
850 /*
851 *-----------------------------------------------------------------------------
852 *
853 * ViewAutoDrawer_SetPinned --
854 *
855 * Set whether the AutoDrawer is pinned or not. When pinned, the
856 * AutoDrawer will stay open regardless of the state of any other inputs.
857 *
858 * Results:
859 * None
860 *
861 * Side effects:
862 * Drawer state is updated.
863 *
864 *-----------------------------------------------------------------------------
865 */
866
867 void
868 ViewAutoDrawer_SetPinned(ViewAutoDrawer *that, // IN
869 gboolean pinned) // IN
870 {
871 g_return_if_fail(VIEW_IS_AUTODRAWER(that));
872
873 that->priv->pinned = pinned;
874
875 /*
876 * This change happens in response to user input. By default, give the user
877 * some time to correct his input before reacting to the change.
878 */
879 ViewAutoDrawerUpdate(that, FALSE);
880 }
881
882
883 /*
884 *-----------------------------------------------------------------------------
885 *
886 * ViewAutoDrawer_SetFill --
887 *
888 * Set whether the Over widget of the AutoDrawer should fill the full
889 * width of the AutoDrawer or just occupy the minimum space it needs.
890 * A value of TRUE overrides offset settings.
891 *
892 * Results:
893 * None
894 *
895 * Side effects:
896 * Drawer state is updated.
897 *
898 *-----------------------------------------------------------------------------
899 */
900
901 void
902 ViewAutoDrawer_SetFill(ViewAutoDrawer *that, // IN
903 gboolean fill) // IN
904 {
905 g_return_if_fail(VIEW_IS_AUTODRAWER(that));
906
907 that->priv->fill = fill;
908 ViewAutoDrawerRefreshPacking(that);
909 }
910
911
912 /*
913 *-----------------------------------------------------------------------------
914 *
915 * ViewAutoDrawer_SetOffset --
916 *
917 * Set the drawer's X offset, or distance in pixels from the left side.
918 * If offset is -1, the drawer will be centered. If fill has been set
919 * TRUE by SetFill, these settings will have no effect.
920 *
921 * Results:
922 * None
923 *
924 * Side effects:
925 * Drawer state is updated.
926 *
927 *-----------------------------------------------------------------------------
928 */
929
930 void
931 ViewAutoDrawer_SetOffset(ViewAutoDrawer *that, // IN
932 gint offset) // IN
933 {
934 g_return_if_fail(VIEW_IS_AUTODRAWER(that));
935
936 that->priv->offset = offset;
937 ViewAutoDrawerRefreshPacking(that);
938 }
939
940
941 /*
942 *-----------------------------------------------------------------------------
943 *
944 * ViewAutoDrawer_Close --
945 *
946 * Closes the drawer. This will not unset the pinned state.
947 *
948 * Results:
949 * None
950 *
951 * Side effects:
952 * Drawer state is updated. If there is a focused widget inside the
953 * drawer, unfocus it.
954 *
955 *-----------------------------------------------------------------------------
956 */
957
958 void
959 ViewAutoDrawer_Close(ViewAutoDrawer *that) // IN
960 {
961 GtkWindow *window;
962 GtkWidget *focus;
963 GtkWidget *toplevel;
964
965 g_return_if_fail(VIEW_IS_AUTODRAWER(that));
966 toplevel = gtk_widget_get_toplevel(GTK_WIDGET(that));
967
968 if (!toplevel || !gtk_widget_is_toplevel(toplevel)) {
969 // The autoDrawer cannot function properly without a toplevel.
970 return;
971 }
972 window = GTK_WINDOW(toplevel);
973
974 focus = gtk_window_get_focus(window);
975 if (focus && gtk_widget_is_ancestor(focus, that->priv->evBox)) {
976 gtk_window_set_focus(window, NULL);
977 }
978
979 that->priv->forceClosing = TRUE;
980 that->priv->closeConnection =
981 g_timeout_add(ViewDrawer_GetCloseTime(&that->parent) +
982 that->priv->delayValue,
983 (GSourceFunc)ViewAutoDrawerOnCloseDelay, that);
984
985 /* This change happens programmatically. Always react to it immediately. */
986 ViewAutoDrawerUpdate(that, TRUE);
987 }
0 /* *************************************************************************
1 * Copyright (c) 2005 VMware Inc.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining
4 * a copy of this software and associated documentation files (the
5 * "Software"), to deal in the Software without restriction, including
6 * without limitation the rights to use, copy, modify, merge, publish,
7 * distribute, sublicense, and/or sell copies of the Software, and to
8 * permit persons to whom the Software is furnished to do so, subject to
9 * the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 * *************************************************************************/
22
23 /*
24 * autoDrawer.h --
25 *
26 * Declarations for the ViewAutoDrawer GTK+ widget.
27 */
28
29
30 #ifndef LIBVIEW_AUTODRAWER_H
31 #define LIBVIEW_AUTODRAWER_H
32
33
34 #include "drawer.h"
35
36
37 #define VIEW_TYPE_AUTODRAWER (ViewAutoDrawer_GetType())
38 #define VIEW_AUTODRAWER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), VIEW_TYPE_AUTODRAWER, ViewAutoDrawer))
39 #define VIEW_AUTODRAWER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), VIEW_TYPE_AUTODRAWER, ViewAutoDrawerClass))
40 #define VIEW_IS_AUTODRAWER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIEW_TYPE_AUTODRAWER))
41 #define VIEW_IS_AUTODRAWER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), VIEW_TYPE_AUTODRAWER))
42 #define VIEW_AUTODRAWER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), VIEW_TYPE_AUTODRAWER, ViewAutoDrawerClass))
43
44 typedef struct _ViewAutoDrawerPrivate ViewAutoDrawerPrivate;
45
46 typedef struct _ViewAutoDrawer {
47 /* Must come first. */
48 ViewDrawer parent;
49
50 /* Private. */
51 ViewAutoDrawerPrivate *priv;
52 } ViewAutoDrawer;
53
54 typedef struct _ViewAutoDrawerClass {
55 /* Must come first. */
56 ViewDrawerClass parent;
57
58 /* Padding for future expansion */
59 void (*_view_reserved0)(void);
60 void (*_view_reserved1)(void);
61 void (*_view_reserved2)(void);
62 void (*_view_reserved3)(void);
63 } ViewAutoDrawerClass;
64
65
66 G_BEGIN_DECLS
67
68
69 GType ViewAutoDrawer_GetType(void);
70
71 GtkWidget *ViewAutoDrawer_New(void);
72
73 void ViewAutoDrawer_SetSlideDelay(ViewAutoDrawer *that, guint delay);
74 void ViewAutoDrawer_SetOverlapPixels(ViewAutoDrawer *that, guint overlapPixels);
75 void ViewAutoDrawer_SetNoOverlapPixels(ViewAutoDrawer *that, guint noOverlapPixels);
76
77 void ViewAutoDrawer_SetActive(ViewAutoDrawer *that, gboolean active);
78
79 void ViewAutoDrawer_SetPinned(ViewAutoDrawer *that, gboolean pinned);
80
81 void ViewAutoDrawer_SetFill(ViewAutoDrawer *that, gboolean fill);
82
83 void ViewAutoDrawer_SetOffset(ViewAutoDrawer *that, gint offset);
84
85 void ViewAutoDrawer_Close(ViewAutoDrawer *that);
86
87 G_END_DECLS
88
89
90 #endif /* LIBVIEW_AUTODRAWER_H */
0 /* *************************************************************************
1 * Copyright (c) 2005 VMware, Inc.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining
4 * a copy of this software and associated documentation files (the
5 * "Software"), to deal in the Software without restriction, including
6 * without limitation the rights to use, copy, modify, merge, publish,
7 * distribute, sublicense, and/or sell copies of the Software, and to
8 * permit persons to whom the Software is furnished to do so, subject to
9 * the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 * *************************************************************************/
22
23 /*
24 * drawer.c -
25 *
26 * Implementation of a GTK+ drawer, i.e. a widget that opens and closes by
27 * sliding smoothly, at constant speed, over another one.
28 */
29
30
31 #include "drawer.h"
32
33
34 struct _ViewDrawerPrivate
35 {
36 unsigned int period;
37 double step;
38 double goal;
39 struct {
40 gboolean pending;
41 guint id;
42 } timer;
43 };
44
45 #define VIEW_DRAWER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), VIEW_TYPE_DRAWER, ViewDrawerPrivate))
46
47 /* The unaltered parent class. */
48 static ViewOvBoxClass *parentClass;
49
50
51 /*
52 *-----------------------------------------------------------------------------
53 *
54 * ViewDrawerInit --
55 *
56 * Initialize a ViewDrawer.
57 *
58 * Results:
59 * None
60 *
61 * Side effects:
62 * None
63 *
64 *-----------------------------------------------------------------------------
65 */
66
67 static void
68 ViewDrawerInit(GTypeInstance *instance, // IN
69 gpointer klass G_GNUC_UNUSED) // Unused
70 {
71 ViewDrawer *that;
72
73 that = VIEW_DRAWER(instance);
74 that->priv = VIEW_DRAWER_GET_PRIVATE(that);
75
76 that->priv->period = 10;
77 that->priv->step = 0.2;
78 that->priv->timer.pending = FALSE;
79 }
80
81
82 /*
83 *-----------------------------------------------------------------------------
84 *
85 * ViewDrawerFinalize --
86 *
87 * "finalize" method of a ViewOvBox.
88 *
89 * Results:
90 * None
91 *
92 * Side effects:
93 * None
94 *
95 *-----------------------------------------------------------------------------
96 */
97
98 static void
99 ViewDrawerFinalize(GObject *object) // IN
100 {
101 ViewDrawer *that;
102 ViewDrawerPrivate *priv;
103
104 that = VIEW_DRAWER(object);
105 priv = that->priv;
106
107 if (priv->timer.pending) {
108 g_source_remove(priv->timer.id);
109 priv->timer.pending = FALSE;
110 }
111
112 G_OBJECT_CLASS(parentClass)->finalize(object);
113 }
114
115
116 /*
117 *-----------------------------------------------------------------------------
118 *
119 * ViewDrawerClassInit --
120 *
121 * Initialize the ViewDrawerClass.
122 *
123 * Results:
124 * None
125 *
126 * Side effects:
127 * None
128 *
129 *-----------------------------------------------------------------------------
130 */
131
132 static void
133 ViewDrawerClassInit(gpointer klass) // IN
134 {
135 GObjectClass *objectClass = G_OBJECT_CLASS(klass);
136
137 parentClass = g_type_class_peek_parent(klass);
138
139 objectClass->finalize = ViewDrawerFinalize;
140
141 g_type_class_add_private(objectClass, sizeof(ViewDrawerPrivate));
142 }
143
144
145 /*
146 *-----------------------------------------------------------------------------
147 *
148 * ViewDrawer_GetType --
149 *
150 * Get the (memoized) GType of the ViewDrawer GTK+ object.
151 *
152 * Results:
153 * The GType
154 *
155 * Side effects:
156 * None
157 *
158 *-----------------------------------------------------------------------------
159 */
160
161 GType
162 ViewDrawer_GetType(void)
163 {
164 static GType type = 0;
165
166 if (type == 0) {
167 static const GTypeInfo info = {
168 sizeof (ViewDrawerClass),
169 NULL, /* BaseInit */
170 NULL, /* BaseFinalize */
171 (GClassInitFunc)ViewDrawerClassInit,
172 NULL,
173 NULL, /* Class Data */
174 sizeof (ViewDrawer),
175 0, /* n_preallocs */
176 (GInstanceInitFunc)ViewDrawerInit,
177 NULL
178 };
179
180 type = g_type_register_static(VIEW_TYPE_OV_BOX, "ViewDrawer", &info, 0);
181 }
182
183 return type;
184 }
185
186
187 /*
188 *-----------------------------------------------------------------------------
189 *
190 * ViewDrawer_New --
191 *
192 * Create a new ViewDrawer GTK+ widget.
193 *
194 * Results:
195 * The widget
196 *
197 * Side effects:
198 * None
199 *
200 *-----------------------------------------------------------------------------
201 */
202
203 GtkWidget *
204 ViewDrawer_New(void)
205 {
206 ViewDrawer *that;
207
208 that = VIEW_DRAWER(g_object_new(VIEW_TYPE_DRAWER, NULL));
209
210 return GTK_WIDGET(that);
211 }
212
213
214 /*
215 *-----------------------------------------------------------------------------
216 *
217 * ViewDrawerOnTimer --
218 *
219 * Timer callback of a ViewDrawer. If we have reached the goal, deschedule
220 * the timer. Otherwise make progress towards the goal, and keep the timer
221 * scheduled.
222 *
223 * Results:
224 * TRUE if the timer must be rescheduled.
225 * FALSE if the timer must not be rescheduled.
226 *
227 * Side effects:
228 * None
229 *
230 *-----------------------------------------------------------------------------
231 */
232
233 static gint
234 ViewDrawerOnTimer(gpointer data) // IN
235 {
236 ViewDrawer *that;
237 ViewDrawerPrivate *priv;
238 double fraction;
239
240 that = VIEW_DRAWER(data);
241 priv = that->priv;
242
243 fraction = ViewOvBox_GetFraction(VIEW_OV_BOX(that));
244 /*
245 * Comparing double values with '==' is most of the time a bad idea, due to
246 * the inexact representation of values in binary (see
247 * http://www2.hursley.ibm.com/decimal/decifaq1.html and http://boost.org/libs/test/doc/components/test_tools/floating_point_comparison.html).
248 * But in this particular case it is legitimate. --hpreg
249 */
250 if (priv->goal == fraction) {
251 return priv->timer.pending = FALSE;
252 }
253
254 ViewOvBox_SetFraction(VIEW_OV_BOX(that),
255 priv->goal > fraction
256 ? MIN(fraction + priv->step, priv->goal)
257 : MAX(fraction - priv->step, priv->goal));
258 return TRUE;
259 }
260
261
262 /*
263 *-----------------------------------------------------------------------------
264 *
265 * ViewDrawer_SetSpeed --
266 *
267 * Set the 'period' (in ms.) and 'step' properties of a ViewDrawer, which
268 * determine the speed and smoothness of the drawer's motion.
269 *
270 * Results:
271 * None
272 *
273 * Side effects:
274 * None
275 *
276 *-----------------------------------------------------------------------------
277 */
278
279 void
280 ViewDrawer_SetSpeed(ViewDrawer *that, // IN
281 unsigned int period, // IN
282 double step) // IN
283 {
284 ViewDrawerPrivate *priv;
285
286 g_return_if_fail(that != NULL);
287
288 priv = that->priv;
289
290 priv->period = period;
291 if (priv->timer.pending) {
292 g_source_remove(priv->timer.id);
293 priv->timer.id = g_timeout_add(priv->period, ViewDrawerOnTimer, that);
294 }
295 priv->step = step;
296 }
297
298
299 /*
300 *-----------------------------------------------------------------------------
301 *
302 * ViewDrawer_SetGoal --
303 *
304 * Set the 'goal' property of a ViewDrawer, i.e. how much the drawer should
305 * be opened when it is done sliding.
306 *
307 * Results:
308 * None
309 *
310 * Side effects:
311 * None
312 *
313 *-----------------------------------------------------------------------------
314 */
315
316 void
317 ViewDrawer_SetGoal(ViewDrawer *that, // IN
318 double goal) // IN
319 {
320 ViewDrawerPrivate *priv;
321
322 g_return_if_fail(that != NULL);
323 g_return_if_fail(goal >= 0 && goal <= 1);
324
325 priv = that->priv;
326
327 priv->goal = goal;
328 if (priv->timer.pending == FALSE) {
329 priv->timer.id = g_timeout_add(priv->period, ViewDrawerOnTimer, that);
330 priv->timer.pending = TRUE;
331 }
332 }
333
334
335 /*
336 *-----------------------------------------------------------------------------
337 *
338 * ViewDrawer_GetCloseTime --
339 *
340 * Get the approximate amount of time it will take for this drawer to
341 * open and close, in ms.
342 *
343 * Results:
344 * The time it takes to open or close the drawer.
345 *
346 * Side effects:
347 * None
348 *
349 *-----------------------------------------------------------------------------
350 */
351
352 int
353 ViewDrawer_GetCloseTime(ViewDrawer *that)
354 {
355 ViewDrawerPrivate *priv;
356
357 if (that == NULL) {
358 return 0;
359 }
360
361 priv = that->priv;
362
363 return priv->period * ((int)(1/priv->step) + 1);
364 }
0 /* *************************************************************************
1 * Copyright (c) 2005 VMware, Inc.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining
4 * a copy of this software and associated documentation files (the
5 * "Software"), to deal in the Software without restriction, including
6 * without limitation the rights to use, copy, modify, merge, publish,
7 * distribute, sublicense, and/or sell copies of the Software, and to
8 * permit persons to whom the Software is furnished to do so, subject to
9 * the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 * *************************************************************************/
22
23 /*
24 * drawer.h --
25 *
26 * Declarations for the ViewDrawer GTK+ widget.
27 */
28
29
30 #ifndef LIBVIEW_DRAWER_H
31 #define LIBVIEW_DRAWER_H
32
33
34 #include "ovBox.h"
35
36
37 #define VIEW_TYPE_DRAWER (ViewDrawer_GetType())
38 #define VIEW_DRAWER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), VIEW_TYPE_DRAWER, ViewDrawer))
39 #define VIEW_DRAWER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), VIEW_TYPE_DRAWER, ViewDrawerClass))
40 #define VIEW_IS_DRAWER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIEW_TYPE_DRAWER))
41 #define VIEW_IS_DRAWER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), VIEW_TYPE_DRAWER))
42 #define VIEW_DRAWER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), VIEW_TYPE_DRAWER, ViewDrawerClass))
43
44 typedef struct _ViewDrawerPrivate ViewDrawerPrivate;
45
46 typedef struct _ViewDrawer {
47 /* Must come first. */
48 ViewOvBox parent;
49
50 /* Private. */
51 ViewDrawerPrivate *priv;
52 } ViewDrawer;
53
54
55 typedef struct _ViewDrawerClass {
56 /* Must come first. */
57 ViewOvBoxClass parent;
58
59 /* Padding for future expansion */
60 void (*_view_reserved0)(void);
61 void (*_view_reserved1)(void);
62 void (*_view_reserved2)(void);
63 void (*_view_reserved3)(void);
64 } ViewDrawerClass;
65
66
67 G_BEGIN_DECLS
68
69
70 GType ViewDrawer_GetType(void);
71
72 GtkWidget *ViewDrawer_New(void);
73
74 void ViewDrawer_SetSpeed(ViewDrawer *that, unsigned int period, double step);
75 void ViewDrawer_SetGoal(ViewDrawer *that, double fraction);
76 int ViewDrawer_GetCloseTime(ViewDrawer *that);
77
78
79 G_END_DECLS
80
81
82 #endif /* LIBVIEW_DRAWER_H */
0 /* *************************************************************************
1 * Copyright (c) 2005 VMware, Inc.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining
4 * a copy of this software and associated documentation files (the
5 * "Software"), to deal in the Software without restriction, including
6 * without limitation the rights to use, copy, modify, merge, publish,
7 * distribute, sublicense, and/or sell copies of the Software, and to
8 * permit persons to whom the Software is furnished to do so, subject to
9 * the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 * *************************************************************************/
22
23 /*
24 * ovBox.c --
25 *
26 * Implementation of a GTK+ overlapping box. Allows you to display and
27 * quickly move a child that overlaps another child.
28 *
29 * Implementation notes
30 * --------------------
31 *
32 * Changing 'fraction' is fast (we just move the 'overWin' X window, which
33 * ultimately copies a rectangle on the X server side), and does not
34 * flicker (the 'under' and 'over' GTK children are not re-drawn, except
35 * for parts of them that become exposed).
36 *
37 * o Initially, we thought it could be done with only 2 X windows
38 *
39 * Layout Hierarchy
40 * ------ ---------
41 *
42 * /- overWin --\ underWin
43 * | | overWin
44 * /-+- underWin -+-\
45 * | | | |
46 * | \------------/ |
47 * | |
48 * \----------------/
49 *
50 * But the 'under' GTK child could create other X windows inside
51 * 'underWin', which makes it impossible to guarantee that 'overWin'
52 * will stay stacked on top.
53 *
54 * o So we are forced to use 3 X windows
55 *
56 * Layout Hierarchy
57 * ------ ---------
58 *
59 * /- overWin --\ window
60 * | | overWin
61 * /---+- window ---+---\ underWin
62 * | | | |
63 * | /-+- underWin -+-\ |
64 * | | | | | |
65 * | | \------------/ | |
66 * | | | |
67 * | \----------------/ |
68 * | |
69 * \--------------------/
70 *
71 * --hpreg
72 */
73
74
75 #include "ovBox.h"
76
77 #if ! GTK_CHECK_VERSION(3, 0, 0)
78 #define gtk_widget_set_realized(widget, val) \
79 GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED)
80 #define gtk_widget_get_realized(widget) \
81 GTK_WIDGET_REALIZED(widget)
82 #endif
83
84 struct _ViewOvBoxPrivate
85 {
86 GdkWindow *underWin;
87 GtkWidget *under;
88 GdkWindow *overWin;
89 GtkWidget *over;
90 GtkRequisition overR;
91 unsigned int min;
92 double fraction;
93 gint verticalOffset;
94 };
95
96 #define VIEW_OV_BOX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), VIEW_TYPE_OV_BOX, ViewOvBoxPrivate))
97
98 /* The unaltered parent class. */
99 static GtkBoxClass *parentClass;
100
101
102 /*
103 *-----------------------------------------------------------------------------
104 *
105 * ViewOvBoxInit --
106 *
107 * Initialize a ViewOvBox.
108 *
109 * Results:
110 * None
111 *
112 * Side effects:
113 * None
114 *
115 *-----------------------------------------------------------------------------
116 */
117
118 static void
119 ViewOvBoxInit(GTypeInstance *instance, // IN
120 gpointer klass G_GNUC_UNUSED) // Unused
121 {
122 ViewOvBox *that;
123 ViewOvBoxPrivate *priv;
124
125 that = VIEW_OV_BOX(instance);
126 that->priv = VIEW_OV_BOX_GET_PRIVATE(that);
127 priv = that->priv;
128
129 gtk_widget_set_has_window (GTK_WIDGET (that), TRUE);
130
131 priv->underWin = NULL;
132 priv->under = NULL;
133 priv->overWin = NULL;
134 priv->over = NULL;
135 priv->overR.height = -1;
136 priv->overR.width = -1;
137 priv->min = 0;
138 priv->fraction = 0;
139 priv->verticalOffset = 0;
140 }
141
142
143 /*
144 *-----------------------------------------------------------------------------
145 *
146 * ViewOvBoxMap --
147 *
148 * "map" method of a ViewOvBox.
149 *
150 * Results:
151 * None
152 *
153 * Side effects:
154 * None
155 *
156 *-----------------------------------------------------------------------------
157 */
158
159 static void
160 ViewOvBoxMap(GtkWidget *widget) // IN
161 {
162 gdk_window_show(gtk_widget_get_window (widget));
163 GTK_WIDGET_CLASS(parentClass)->map(widget);
164 }
165
166
167 /*
168 *-----------------------------------------------------------------------------
169 *
170 * ViewOvBoxUnmap --
171 *
172 * "unmap" method of a ViewOvBox.
173 *
174 * Results:
175 * None
176 *
177 * Side effects:
178 * None
179 *
180 *-----------------------------------------------------------------------------
181 */
182
183 static void
184 ViewOvBoxUnmap(GtkWidget *widget) // IN
185 {
186 gdk_window_hide(gtk_widget_get_window (widget));
187 GTK_WIDGET_CLASS(parentClass)->unmap(widget);
188 }
189
190
191 /*
192 *-----------------------------------------------------------------------------
193 *
194 * ViewOvBoxGetActualMin --
195 *
196 * Retrieve the actual 'min' value, i.e. a value that is guaranteed not to
197 * exceed the height of the 'over' child.
198 *
199 * Results:
200 * The actual 'min' value.
201 *
202 * Side effects:
203 * None
204 *
205 *-----------------------------------------------------------------------------
206 */
207
208 static inline unsigned int
209 ViewOvBoxGetActualMin(ViewOvBox *that) // IN
210 {
211 return MIN(that->priv->min, that->priv->overR.height);
212 }
213
214
215 /*
216 *-----------------------------------------------------------------------------
217 *
218 * ViewOvBoxGetUnderGeometry --
219 *
220 * Retrieve the geometry to apply to 'that->underWin'.
221 *
222 * Results:
223 * The geometry
224 *
225 * Side effects:
226 * None
227 *
228 *-----------------------------------------------------------------------------
229 */
230
231 static void
232 ViewOvBoxGetUnderGeometry(ViewOvBox *that, // IN
233 int *x, // OUT
234 int *y, // OUT
235 int *width, // OUT
236 int *height) // OUT
237 {
238 unsigned int min;
239 GtkAllocation allocation;
240
241 min = ViewOvBoxGetActualMin(that);
242 gtk_widget_get_allocation (GTK_WIDGET(that), &allocation);
243
244 *x = 0;
245 *y = min;
246 *width = allocation.width;
247 *height = allocation.height - min;
248 }
249
250
251 /*
252 *-----------------------------------------------------------------------------
253 *
254 * ViewOvBoxGetOverGeometry --
255 *
256 * Retrieve the geometry to apply to 'that->overWin'.
257 *
258 * Results:
259 * The geometry
260 *
261 * Side effects:
262 * None
263 *
264 *-----------------------------------------------------------------------------
265 */
266
267 static void
268 ViewOvBoxGetOverGeometry(ViewOvBox *that, // IN
269 int *x, // OUT
270 int *y, // OUT
271 int *width, // OUT
272 int *height) // OUT
273 {
274 ViewOvBoxPrivate *priv;
275 gboolean expand;
276 gboolean fill;
277 guint padding;
278 unsigned int boxWidth;
279 GtkAllocation allocation;
280
281 priv = that->priv;
282
283 if (priv->over) {
284 /*
285 * When a child's expand or fill property changes, GtkBox queues
286 * a resize for the child.
287 */
288 gtk_container_child_get(GTK_CONTAINER(that), priv->over,
289 "expand", &expand,
290 "fill", &fill,
291 "padding", &padding,
292 NULL);
293 } else {
294 /* Default values used by GtkBox. */
295 expand = TRUE;
296 fill = TRUE;
297 padding = 0;
298 }
299
300 gtk_widget_get_allocation(GTK_WIDGET(that), &allocation);
301 boxWidth = allocation.width;
302 if (!expand) {
303 *width = MIN(priv->overR.width, boxWidth - padding);
304 *x = padding;
305 } else if (!fill) {
306 *width = MIN(priv->overR.width, boxWidth);
307 *x = (boxWidth - *width) / 2;
308 } else {
309 *width = boxWidth;
310 *x = 0;
311 }
312
313 *y = (priv->overR.height - ViewOvBoxGetActualMin(that))
314 * (priv->fraction - 1) + priv->verticalOffset;
315 *height = priv->overR.height;
316 }
317
318
319 /*
320 *-----------------------------------------------------------------------------
321 *
322 * ViewOvBoxSetBackground --
323 *
324 * Set the background color of the 'underWin' and 'overWin' X windows.
325 *
326 * Results:
327 * None
328 *
329 * Side effects:
330 * None
331 *
332 *-----------------------------------------------------------------------------
333 */
334
335 static void
336 ViewOvBoxSetBackground(ViewOvBox *that) // IN
337 {
338 GtkWidget *widget;
339 GtkStyle *style;
340
341 widget = GTK_WIDGET(that);
342 style = gtk_widget_get_style (widget);
343 gtk_style_set_background(style, gtk_widget_get_window(widget), GTK_STATE_NORMAL);
344 gtk_style_set_background(style, that->priv->underWin, GTK_STATE_NORMAL);
345 gtk_style_set_background(style, that->priv->overWin, GTK_STATE_NORMAL);
346 }
347
348
349 /*
350 *-----------------------------------------------------------------------------
351 *
352 * ViewOvBoxRealize --
353 *
354 * "realize" method of a ViewOvBox.
355 *
356 * Results:
357 * None
358 *
359 * Side effects:
360 * None
361 *
362 *-----------------------------------------------------------------------------
363 */
364
365 static void
366 ViewOvBoxRealize(GtkWidget *widget) // IN
367 {
368 ViewOvBox *that;
369 ViewOvBoxPrivate *priv;
370 GdkWindowAttr attributes;
371 gint mask;
372 GtkAllocation allocation;
373 GdkWindow *window;
374
375 gtk_widget_set_realized (widget, TRUE);
376
377 that = VIEW_OV_BOX(widget);
378 priv = that->priv;
379
380 attributes.window_type = GDK_WINDOW_CHILD;
381 attributes.wclass = GDK_INPUT_OUTPUT;
382 attributes.visual = gtk_widget_get_visual(widget);
383 attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK;
384 mask = GDK_WA_VISUAL | GDK_WA_X | GDK_WA_Y;
385
386 gtk_widget_get_allocation(widget, &allocation);
387 attributes.x = allocation.x;
388 attributes.y = allocation.y;
389 attributes.width = allocation.width;
390 attributes.height = allocation.height;
391 window = gdk_window_new(gtk_widget_get_parent_window(widget),
392 &attributes, mask);
393 gtk_widget_set_window(widget, window);
394 gdk_window_set_user_data(window, that);
395 gtk_widget_set_style(widget, gtk_style_attach(gtk_widget_get_style(widget), window));
396
397 /*
398 * The order in which we create the children X window matters: the child
399 * created last is stacked on top. --hpreg
400 */
401
402 ViewOvBoxGetUnderGeometry(that, &attributes.x, &attributes.y,
403 &attributes.width, &attributes.height);
404 priv->underWin = gdk_window_new(window, &attributes, mask);
405 gdk_window_set_user_data(priv->underWin, that);
406 if (priv->under) {
407 gtk_widget_set_parent_window(priv->under, priv->underWin);
408 }
409 gdk_window_show(priv->underWin);
410
411 ViewOvBoxGetOverGeometry(that, &attributes.x, &attributes.y,
412 &attributes.width, &attributes.height);
413 priv->overWin = gdk_window_new(window, &attributes, mask);
414 gdk_window_set_user_data(priv->overWin, that);
415 if (priv->over) {
416 gtk_widget_set_parent_window(priv->over, priv->overWin);
417 }
418 gdk_window_show(priv->overWin);
419
420 ViewOvBoxSetBackground(that);
421 }
422
423
424 /*
425 *-----------------------------------------------------------------------------
426 *
427 * ViewOvBoxUnrealize --
428 *
429 * "unrealize" method of a ViewOvBox.
430 *
431 * Results:
432 * None
433 *
434 * Side effects:
435 * None
436 *
437 *-----------------------------------------------------------------------------
438 */
439
440 static void
441 ViewOvBoxUnrealize(GtkWidget *widget) // IN
442 {
443 ViewOvBox *that;
444 ViewOvBoxPrivate *priv;
445
446 that = VIEW_OV_BOX(widget);
447 priv = that->priv;
448
449 /*
450 * Unrealize the parent before destroying the windows so that we end up
451 * unrealizing all the child widgets before destroying the child windows,
452 * giving them a chance to reparent their windows before we clobber them.
453 */
454 GTK_WIDGET_CLASS(parentClass)->unrealize(widget);
455
456
457 gdk_window_set_user_data(priv->underWin, NULL);
458 gdk_window_destroy(priv->underWin);
459 priv->underWin = NULL;
460
461 gdk_window_set_user_data(priv->overWin, NULL);
462 gdk_window_destroy(priv->overWin);
463 priv->overWin = NULL;
464
465 }
466
467
468 /*
469 *-----------------------------------------------------------------------------
470 *
471 * ViewOvBoxSizeRequest --
472 *
473 * "size_request" method of a ViewOvBox.
474 *
475 * Results:
476 * None
477 *
478 * Side effects:
479 * None
480 *
481 *-----------------------------------------------------------------------------
482 */
483 static void
484 ViewOvBoxSizeRequest(GtkWidget *widget, // IN
485 GtkRequisition *requisition) // OUT
486 {
487 ViewOvBox *that;
488 ViewOvBoxPrivate *priv;
489 GtkRequisition underR;
490 gboolean expand;
491 gboolean fill;
492 guint padding;
493 unsigned int min;
494
495 that = VIEW_OV_BOX(widget);
496 priv = that->priv;
497
498 gtk_widget_size_request(priv->under, &underR);
499 gtk_widget_size_request(priv->over, &priv->overR);
500
501 gtk_container_child_get(GTK_CONTAINER(that), priv->over,
502 "expand", &expand,
503 "fill", &fill,
504 "padding", &padding,
505 NULL);
506 requisition->width = MAX(underR.width,
507 priv->overR.width + ((expand || fill) ? 0 : padding));
508 min = ViewOvBoxGetActualMin(that);
509 requisition->height = MAX(underR.height + min, priv->overR.height);
510 }
511
512 #if GTK_CHECK_VERSION(3, 0, 0)
513 static void
514 ViewOvBox_get_preferred_width (GtkWidget *widget,
515 gint *minimal_width,
516 gint *natural_width)
517 {
518 GtkRequisition requisition;
519
520 ViewOvBoxSizeRequest (widget, &requisition);
521
522 *minimal_width = *natural_width = requisition.width;
523 }
524
525 static void
526 ViewOvBox_get_preferred_height (GtkWidget *widget,
527 gint *minimal_height,
528 gint *natural_height)
529 {
530 GtkRequisition requisition;
531
532 ViewOvBoxSizeRequest (widget, &requisition);
533
534 *minimal_height = *natural_height = requisition.height;
535 }
536 #endif
537
538
539 /*
540 *-----------------------------------------------------------------------------
541 *
542 * ViewOvBoxSizeAllocate --
543 *
544 * "size_allocate" method of a ViewOvBox.
545 *
546 * Results:
547 * None
548 *
549 * Side effects:
550 * None
551 *
552 *-----------------------------------------------------------------------------
553 */
554
555 static void
556 ViewOvBoxSizeAllocate(GtkWidget *widget, // IN
557 GtkAllocation *allocation) // IN
558 {
559 ViewOvBox *that;
560 ViewOvBoxPrivate *priv;
561 GtkAllocation under;
562 GtkAllocation over;
563
564 gtk_widget_set_allocation (widget, allocation);
565
566 that = VIEW_OV_BOX(widget);
567 priv = that->priv;
568
569 ViewOvBoxGetUnderGeometry(that, &under.x, &under.y, &under.width,
570 &under.height);
571 ViewOvBoxGetOverGeometry(that, &over.x, &over.y, &over.width, &over.height);
572
573 if (gtk_widget_get_realized(widget)) {
574 gdk_window_move_resize(gtk_widget_get_window(widget),
575 allocation->x, allocation->y,
576 allocation->width, allocation->height);
577 gdk_window_move_resize(priv->underWin, under.x, under.y, under.width,
578 under.height);
579 gdk_window_move_resize(priv->overWin, over.x, over.y, over.width,
580 over.height);
581 }
582
583 under.x = 0;
584 under.y = 0;
585 gtk_widget_size_allocate(priv->under, &under);
586 over.x = 0;
587 over.y = 0;
588 gtk_widget_size_allocate(priv->over, &over);
589 }
590
591
592 /*
593 *-----------------------------------------------------------------------------
594 *
595 * ViewOvBoxStyleSet --
596 *
597 * "style_set" method of a ViewOvBox.
598 *
599 * Results:
600 * None
601 *
602 * Side effects:
603 * None
604 *
605 *-----------------------------------------------------------------------------
606 */
607
608 static void
609 ViewOvBoxStyleSet(GtkWidget *widget, // IN
610 GtkStyle *previousStyle) // IN: Unused
611 {
612 ViewOvBox *that;
613
614 that = VIEW_OV_BOX(widget);
615
616 if (gtk_widget_get_realized(widget)) {
617 ViewOvBoxSetBackground(that);
618 }
619
620 GTK_WIDGET_CLASS(parentClass)->style_set(widget, previousStyle);
621 }
622
623
624 /*
625 *-----------------------------------------------------------------------------
626 *
627 * ViewOvBoxSetChild --
628 *
629 * Set a child of a ViewOvBox.
630 *
631 * Results:
632 * None
633 *
634 * Side effects:
635 * None
636 *
637 *-----------------------------------------------------------------------------
638 */
639
640 static void
641 ViewOvBoxSetChild(ViewOvBox *that, // IN
642 GtkWidget **child, // IN
643 GdkWindow *childWin, // IN
644 GtkWidget *widget) // IN
645 {
646 GtkWidget *oldChild = *child;
647
648 if (oldChild) {
649 g_object_ref(oldChild);
650 gtk_container_remove(GTK_CONTAINER(that), oldChild);
651 }
652
653 *child = widget;
654 if (*child) {
655 gtk_widget_set_parent_window(widget, childWin);
656 gtk_container_add(GTK_CONTAINER(that), *child);
657 }
658
659 if (oldChild) {
660 g_object_unref(oldChild);
661 }
662 }
663
664
665 /*
666 *-----------------------------------------------------------------------------
667 *
668 * ViewOvBoxSetOver --
669 *
670 * Base implementation of ViewOvBox_SetOver.
671 *
672 * Results:
673 * None
674 *
675 * Side effects:
676 * None
677 *
678 *-----------------------------------------------------------------------------
679 */
680
681 static void
682 ViewOvBoxSetOver(ViewOvBox *that, // IN
683 GtkWidget *widget) // IN
684 {
685 ViewOvBoxSetChild(that, &that->priv->over, that->priv->overWin, widget);
686 }
687
688
689 /*
690 *-----------------------------------------------------------------------------
691 *
692 * ViewOvBoxClassInit --
693 *
694 * Initialize the ViewOvBoxClass.
695 *
696 * Results:
697 * None
698 *
699 * Side effects:
700 * None
701 *
702 *-----------------------------------------------------------------------------
703 */
704
705 static void
706 ViewOvBoxClassInit(ViewOvBoxClass *klass) // IN
707 {
708 GObjectClass *objectClass;
709 GtkWidgetClass *widgetClass;
710
711 objectClass = G_OBJECT_CLASS(klass);
712 widgetClass = GTK_WIDGET_CLASS(klass);
713
714 widgetClass->map = ViewOvBoxMap;
715 widgetClass->unmap = ViewOvBoxUnmap;
716 widgetClass->realize = ViewOvBoxRealize;
717 widgetClass->unrealize = ViewOvBoxUnrealize;
718 #if GTK_CHECK_VERSION(3, 0, 0)
719 widgetClass->get_preferred_width = ViewOvBox_get_preferred_width;
720 widgetClass->get_preferred_height = ViewOvBox_get_preferred_height;
721 #else
722 widgetClass->size_request = ViewOvBoxSizeRequest;
723 #endif
724 widgetClass->size_allocate = ViewOvBoxSizeAllocate;
725 widgetClass->style_set = ViewOvBoxStyleSet;
726
727 klass->set_over = ViewOvBoxSetOver;
728
729 parentClass = g_type_class_peek_parent(klass);
730
731 g_type_class_add_private(objectClass, sizeof(ViewOvBoxPrivate));
732 }
733
734
735 /*
736 *-----------------------------------------------------------------------------
737 *
738 * ViewOvBox_GetType --
739 *
740 * Get the (memoized) GType of the ViewOvBox GTK+ object.
741 *
742 * Results:
743 * The GType
744 *
745 * Side effects:
746 * None
747 *
748 *-----------------------------------------------------------------------------
749 */
750
751 GType
752 ViewOvBox_GetType(void)
753 {
754 static GType type = 0;
755
756 if (type == 0) {
757 static const GTypeInfo info = {
758 sizeof (ViewOvBoxClass),
759 NULL, /* BaseInit */
760 NULL, /* BaseFinalize */
761 (GClassInitFunc)ViewOvBoxClassInit,
762 NULL,
763 NULL, /* Class Data */
764 sizeof (ViewOvBox),
765 0, /* n_preallocs */
766 (GInstanceInitFunc)ViewOvBoxInit,
767 NULL,
768 };
769
770 type = g_type_register_static(GTK_TYPE_BOX, "ViewOvBox", &info, 0);
771 }
772
773 return type;
774 }
775
776
777 /*
778 *-----------------------------------------------------------------------------
779 *
780 * ViewOvBox_New --
781 *
782 * Create a new ViewOvBox GTK+ widget.
783 *
784 * Results:
785 * The widget
786 *
787 * Side effects:
788 * None
789 *
790 *-----------------------------------------------------------------------------
791 */
792
793 GtkWidget *
794 ViewOvBox_New(void)
795 {
796 ViewOvBox *that;
797
798 that = VIEW_OV_BOX(g_object_new(VIEW_TYPE_OV_BOX, NULL));
799
800 return GTK_WIDGET(that);
801 }
802
803
804 /*
805 *-----------------------------------------------------------------------------
806 *
807 * ViewOvBox_SetUnder --
808 *
809 * Set the under widget of a ViewOvBox.
810 *
811 * Results:
812 * None
813 *
814 * Side effects:
815 * None
816 *
817 *-----------------------------------------------------------------------------
818 */
819
820 void
821 ViewOvBox_SetUnder(ViewOvBox *that, // IN
822 GtkWidget *widget) // IN
823 {
824 g_return_if_fail(that != NULL);
825
826 ViewOvBoxSetChild(that, &that->priv->under, that->priv->underWin, widget);
827 }
828
829
830 /*
831 *-----------------------------------------------------------------------------
832 *
833 * ViewOvBox_SetOver --
834 *
835 * Set the over widget of a ViewOvBox.
836 *
837 * Results:
838 * None
839 *
840 * Side effects:
841 * None
842 *
843 *-----------------------------------------------------------------------------
844 */
845
846 void
847 ViewOvBox_SetOver(ViewOvBox *that, // IN
848 GtkWidget *widget) // IN
849 {
850 g_return_if_fail(that != NULL);
851
852 VIEW_OV_BOX_GET_CLASS(that)->set_over(that, widget);
853 }
854
855
856 /*
857 *-----------------------------------------------------------------------------
858 *
859 * ViewOvBox_SetMin --
860 *
861 * Set the 'min' property of a ViewOvBox, i.e. the number of pixel of the
862 * 'over' child that should always be displayed without overlapping on the
863 * 'under' child.
864 *
865 * Using a value of -1 displays the 'over' child entirely.
866 *
867 * Results:
868 * None
869 *
870 * Side effects:
871 * None
872 *
873 *-----------------------------------------------------------------------------
874 */
875
876 void
877 ViewOvBox_SetMin(ViewOvBox *that, // IN
878 unsigned int min) // IN
879 {
880 g_return_if_fail(that != NULL);
881
882 that->priv->min = min;
883 gtk_widget_queue_resize(GTK_WIDGET(that));
884 }
885
886
887 /*
888 *-----------------------------------------------------------------------------
889 *
890 * ViewOvBox_SetFraction --
891 *
892 * Set the 'fraction' property of a ViewOvBox, i.e. how much of the 'over'
893 * child should overlap on the 'under' child.
894 *
895 * Results:
896 * None
897 *
898 * Side effects:
899 * None
900 *
901 *-----------------------------------------------------------------------------
902 */
903
904 void
905 ViewOvBox_SetFraction(ViewOvBox *that, // IN
906 double fraction) // IN
907 {
908 g_return_if_fail(that != NULL);
909 g_return_if_fail(fraction >=0 && fraction <= 1);
910
911 that->priv->fraction = fraction;
912 if (gtk_widget_get_realized(GTK_WIDGET (that))) {
913 int x;
914 int y;
915 int width;
916 int height;
917
918 ViewOvBoxGetOverGeometry(that, &x, &y, &width, &height);
919 gdk_window_move(that->priv->overWin, x, y);
920 }
921 }
922
923
924 /*
925 *-----------------------------------------------------------------------------
926 *
927 * ViewOvBox_GetFraction --
928 *
929 * Retrieve the 'fraction' property of a ViewOvBox.
930 *
931 * Results:
932 * The value
933 *
934 * Side effects:
935 * None
936 *
937 *-----------------------------------------------------------------------------
938 */
939
940 double
941 ViewOvBox_GetFraction(ViewOvBox *that)
942 {
943 g_return_val_if_fail(that != NULL, 0);
944
945 return that->priv->fraction;
946 }
0 /* *************************************************************************
1 * Copyright (c) 2005 VMware, Inc.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining
4 * a copy of this software and associated documentation files (the
5 * "Software"), to deal in the Software without restriction, including
6 * without limitation the rights to use, copy, modify, merge, publish,
7 * distribute, sublicense, and/or sell copies of the Software, and to
8 * permit persons to whom the Software is furnished to do so, subject to
9 * the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 * *************************************************************************/
22
23 /*
24 * ovBox.h --
25 *
26 * Declarations for the ViewOvBox GTK+ widget.
27 */
28
29
30 #ifndef LIBVIEW_OVBOX_H
31 #define LIBVIEW_OVBOX_H
32
33
34 #include <gtk/gtk.h>
35
36
37 #define VIEW_TYPE_OV_BOX (ViewOvBox_GetType())
38 #define VIEW_OV_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), VIEW_TYPE_OV_BOX, ViewOvBox))
39 #define VIEW_OV_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), VIEW_TYPE_OV_BOX, ViewOvBoxClass))
40 #define VIEW_IS_OV_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIEW_TYPE_OV_BOX))
41 #define VIEW_IS_OV_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), VIEW_TYPE_OV_BOX))
42 #define VIEW_OV_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), VIEW_TYPE_OV_BOX, ViewOvBoxClass))
43
44 typedef struct _ViewOvBoxPrivate ViewOvBoxPrivate;
45
46 typedef struct _ViewOvBox {
47 /* Must come first. */
48 GtkBox parent;
49
50 /* Private. */
51 ViewOvBoxPrivate *priv;
52 } ViewOvBox;
53
54
55 typedef struct _ViewOvBoxClass {
56 /* Must come first. */
57 GtkBoxClass parent;
58
59 /* Virtual methods. */
60 void (* set_over)(ViewOvBox *ovBox, GtkWidget *widget);
61
62 /* Padding for future expansion */
63 void (*_view_reserved0)(void);
64 void (*_view_reserved1)(void);
65 void (*_view_reserved2)(void);
66 void (*_view_reserved3)(void);
67 } ViewOvBoxClass;
68
69
70 G_BEGIN_DECLS
71
72
73 GType
74 ViewOvBox_GetType(void);
75
76 GtkWidget *
77 ViewOvBox_New(void);
78
79 void
80 ViewOvBox_SetUnder(ViewOvBox *that,
81 GtkWidget *widget);
82
83 void
84 ViewOvBox_SetOver(ViewOvBox *that,
85 GtkWidget *widget);
86
87 void
88 ViewOvBox_SetMin(ViewOvBox *that,
89 unsigned int min);
90
91 void
92 ViewOvBox_SetFraction(ViewOvBox *that,
93 double fraction);
94
95 double
96 ViewOvBox_GetFraction(ViewOvBox *that);
97
98
99 G_END_DECLS
100
101
102 #endif /* LIBVIEW_OVBOX_H */
+0
-124
src/viewer-priv.h less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #ifndef _VIRT_VIEWER_PRIV_H
24 # define _VIRT_VIEWER_PRIV_H
25
26 #include <gtk/gtk.h>
27 #include <glade/glade.h>
28 #include <glib/gi18n.h>
29
30 #include <libvirt/libvirt.h>
31 #include <libvirt/virterror.h>
32 #include <libxml/xpath.h>
33 #include <libxml/uri.h>
34
35 typedef struct _VirtViewerDisplay VirtViewerDisplay;
36 typedef struct _VirtViewerDisplayClass VirtViewerDisplayClass;
37 typedef struct _VirtViewer VirtViewer;
38 typedef struct _VirtViewerSize VirtViewerSize;
39 typedef struct _VirtViewerDisplayChanne VirtViewerDisplayChannel;
40
41 enum menuNums {
42 FILE_MENU,
43 VIEW_MENU,
44 SEND_KEY_MENU,
45 HELP_MENU,
46 LAST_MENU // sentinel
47 };
48
49 struct _VirtViewer {
50 char *uri;
51 virConnectPtr conn;
52 char *domkey;
53 char *domtitle;
54
55 GladeXML *glade;
56 GtkWidget *window;
57 GtkWidget *container;
58
59 char *pretty_address;
60
61 int zoomlevel;
62
63 int desktopWidth;
64 int desktopHeight;
65 gboolean autoResize;
66 gboolean fullscreen;
67 gboolean withEvents;
68
69 gboolean active;
70
71 gboolean accelEnabled;
72 GValue accelSetting;
73 GSList *accelList;
74 int accelMenuSig[LAST_MENU];
75
76 gboolean waitvm;
77 gboolean reconnect;
78 gboolean direct;
79 gboolean verbose;
80 gboolean authretry;
81 gboolean connected;
82
83 gchar *clipboard;
84
85 VirtViewerDisplay *display;
86
87 char *unixsock;
88 char *gport;
89 char *host;
90 char *transport;
91 char *user;
92 int port;
93 };
94
95 struct _VirtViewerSize {
96 VirtViewer *viewer;
97 gint width, height;
98 gulong sig_id;
99 };
100
101 void viewer_connected(VirtViewer *viewer);
102 void viewer_initialized(VirtViewer *viewer);
103 void viewer_disconnected(VirtViewer *viewer);
104 void viewer_set_status(VirtViewer *viewer, const char *text);
105 void viewer_set_title(VirtViewer *viewer, gboolean grabbed);
106 void viewer_enable_modifiers(VirtViewer *viewer);
107 void viewer_disable_modifiers(VirtViewer *viewer);
108 void viewer_add_display_and_realize(VirtViewer *viewer);
109 void viewer_server_cut_text(VirtViewer *viewer, const gchar *text);
110 void viewer_resize_main_window(VirtViewer *viewer);
111 void viewer_channel_open_fd(VirtViewer *viewer, VirtViewerDisplayChannel *channel);
112 void viewer_quit(VirtViewer *viewer);
113
114 void viewer_simple_message_dialog(GtkWidget *window, const char *fmt, ...);
115
116 #endif // _VIRT_VIEWER_PRIV_H
117 /*
118 * Local variables:
119 * c-indent-level: 8
120 * c-basic-offset: 8
121 * tab-width: 8
122 * End:
123 */
+0
-1288
src/viewer.c less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23
24 #include <config.h>
25
26 #include <gdk/gdkkeysyms.h>
27 #include <sys/types.h>
28 #include <sys/stat.h>
29 #include <stdlib.h>
30 #include <string.h>
31 #include <unistd.h>
32 #include <locale.h>
33
34 #ifdef HAVE_SYS_SOCKET_H
35 #include <sys/socket.h>
36 #endif
37
38 #ifdef HAVE_SYS_UN_H
39 #include <sys/un.h>
40 #endif
41
42 #ifdef HAVE_WINDOWS_H
43 #include <windows.h>
44 #endif
45
46 #include "viewer.h"
47 #include "viewer-priv.h"
48 #include "events.h"
49 #include "auth.h"
50 #include "display-vnc.h"
51
52 #ifdef HAVE_SPICE_GTK
53 #include "display-spice.h"
54 #endif
55
56 #define SCALE(x) do { x = viewer->fullscreen ? x : x * viewer->zoomlevel / 100; } while (0);
57
58 gboolean doDebug = FALSE;
59
60 static const char * const menuNames[LAST_MENU] = {
61 "menu-file", "menu-view", "menu-send", "menu-help"
62 };
63
64
65 #define MAX_KEY_COMBO 3
66 struct keyComboDef {
67 guint keys[MAX_KEY_COMBO];
68 guint nkeys;
69 const char *label;
70 };
71
72 static const struct keyComboDef keyCombos[] = {
73 { { GDK_Control_L, GDK_Alt_L, GDK_Delete }, 3, "Ctrl+Alt+_Del"},
74 { { GDK_Control_L, GDK_Alt_L, GDK_BackSpace }, 3, "Ctrl+Alt+_Backspace"},
75 { {}, 0, "" },
76 { { GDK_Control_L, GDK_Alt_L, GDK_F1 }, 3, "Ctrl+Alt+F_1"},
77 { { GDK_Control_L, GDK_Alt_L, GDK_F2 }, 3, "Ctrl+Alt+F_2"},
78 { { GDK_Control_L, GDK_Alt_L, GDK_F3 }, 3, "Ctrl+Alt+F_3"},
79 { { GDK_Control_L, GDK_Alt_L, GDK_F4 }, 3, "Ctrl+Alt+F_4"},
80 { { GDK_Control_L, GDK_Alt_L, GDK_F5 }, 3, "Ctrl+Alt+F_5"},
81 { { GDK_Control_L, GDK_Alt_L, GDK_F6 }, 3, "Ctrl+Alt+F_6"},
82 { { GDK_Control_L, GDK_Alt_L, GDK_F7 }, 3, "Ctrl+Alt+F_7"},
83 { { GDK_Control_L, GDK_Alt_L, GDK_F8 }, 3, "Ctrl+Alt+F_8"},
84 { { GDK_Control_L, GDK_Alt_L, GDK_F5 }, 3, "Ctrl+Alt+F_9"},
85 { { GDK_Control_L, GDK_Alt_L, GDK_F6 }, 3, "Ctrl+Alt+F1_0"},
86 { { GDK_Control_L, GDK_Alt_L, GDK_F7 }, 3, "Ctrl+Alt+F11"},
87 { { GDK_Control_L, GDK_Alt_L, GDK_F8 }, 3, "Ctrl+Alt+F12"},
88 { {}, 0, "" },
89 { { GDK_Print }, 1, "_PrintScreen"},
90 };
91
92
93 static gboolean viewer_connect_timer(void *opaque);
94 static int viewer_initial_connect(VirtViewer *viewer);
95
96
97 void viewer_simple_message_dialog(GtkWidget *window, const char *fmt, ...)
98 {
99 GtkWidget *dialog;
100 char *msg;
101 va_list vargs;
102
103 va_start(vargs, fmt);
104
105 msg = g_strdup_vprintf(fmt, vargs);
106
107 va_end(vargs);
108
109 dialog = gtk_message_dialog_new(GTK_WINDOW(window),
110 GTK_DIALOG_MODAL |
111 GTK_DIALOG_DESTROY_WITH_PARENT,
112 GTK_MESSAGE_ERROR,
113 GTK_BUTTONS_OK,
114 "%s",
115 msg);
116
117 gtk_dialog_run(GTK_DIALOG(dialog));
118
119 gtk_widget_destroy(dialog);
120
121 g_free(msg);
122 }
123
124
125 void viewer_add_display_and_realize(VirtViewer *viewer)
126 {
127 GtkWidget *notebook;
128 GtkWidget *align;
129
130 g_return_if_fail(viewer != NULL);
131 g_return_if_fail(viewer->display != NULL);
132 g_return_if_fail(viewer->display->widget != NULL);
133
134 notebook = glade_xml_get_widget(viewer->glade, "notebook");
135 if (viewer->display->need_align) {
136 align = glade_xml_get_widget(viewer->glade, "display-align");
137 gtk_container_add(GTK_CONTAINER(align), viewer->display->widget);
138 } else {
139 gtk_notebook_remove_page(GTK_NOTEBOOK(notebook), 2);
140 if (gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), viewer->display->widget,
141 NULL, 2) == -1)
142 g_warning("failed to insert a notebook page");
143 }
144
145 if (!viewer->window) {
146 gtk_container_add(GTK_CONTAINER(viewer->container), GTK_WIDGET(notebook));
147 gtk_widget_show_all(viewer->container);
148 }
149
150 gtk_widget_realize(viewer->display->widget);
151 }
152
153 /* Now that the size is set to our preferred sizing, this
154 * triggers another resize calculation but without our
155 * scrolled window callback active. This is the key that
156 * allows us to set the fixed size, but then allow the user
157 * to later resize it smaller again
158 */
159 static gboolean
160 viewer_unset_widget_size_cb(gpointer data)
161 {
162 GtkWidget *widget = data;
163 DEBUG_LOG("Unset requisition on widget=%p", widget);
164
165 gtk_widget_queue_resize_no_redraw (widget);
166
167 return FALSE;
168 }
169
170 /*
171 * This sets the actual size of the widget, and then
172 * sets an idle callback to resize again, without constraints
173 * activated
174 */
175 static gboolean
176 viewer_set_widget_size_cb(GtkWidget *widget,
177 GtkRequisition *req,
178 gpointer data)
179 {
180 VirtViewerSize *size = data;
181 DEBUG_LOG("Set requisition on widget=%p to %dx%d", widget, size->width, size->height);
182
183 req->width = size->width;
184 req->height = size->height;
185
186 g_signal_handler_disconnect (widget, size->sig_id);
187 g_free (size);
188 g_idle_add (viewer_unset_widget_size_cb, widget);
189
190 return FALSE;
191 }
192
193
194 /*
195 * Registers a callback used to set the widget size once
196 */
197 static void
198 viewer_set_widget_size(VirtViewer *viewer,
199 GtkWidget *widget,
200 int width,
201 int height)
202 {
203 VirtViewerSize *size = g_new (VirtViewerSize, 1);
204 DEBUG_LOG("Queue resize widget=%p width=%d height=%d", widget, width, height);
205 size->viewer = viewer;
206 size->width = width;
207 size->height = height;
208 size->sig_id = g_signal_connect
209 (widget, "size-request",
210 G_CALLBACK (viewer_set_widget_size_cb),
211 size);
212
213 gtk_widget_queue_resize (widget);
214 }
215
216
217 /*
218 * This code attempts to resize the top level window to be large enough
219 * to contain the entire display desktop at 1:1 ratio. If the local desktop
220 * isn't large enough that it goes as large as possible and lets the display
221 * scale down to fit, maintaining aspect ratio
222 */
223 void viewer_resize_main_window(VirtViewer *viewer)
224 {
225 GdkRectangle fullscreen;
226 GdkScreen *screen;
227 int width, height;
228 double desktopAspect;
229 double screenAspect;
230
231 DEBUG_LOG("Preparing main window resize");
232 if (!viewer->active) {
233 DEBUG_LOG("Skipping inactive resize");
234 return;
235 }
236
237 gtk_window_resize(GTK_WINDOW (viewer->window), 1, 1);
238
239 screen = gdk_drawable_get_screen(gtk_widget_get_window(viewer->window));
240 gdk_screen_get_monitor_geometry(screen,
241 gdk_screen_get_monitor_at_window
242 (screen, gtk_widget_get_window(viewer->window)),
243 &fullscreen);
244
245 desktopAspect = (double)viewer->desktopWidth / (double)viewer->desktopHeight;
246 screenAspect = (double)(fullscreen.width - 128) / (double)(fullscreen.height - 128);
247
248 if ((viewer->desktopWidth > (fullscreen.width - 128)) ||
249 (viewer->desktopHeight > (fullscreen.height - 128))) {
250 /* Doesn't fit native res, so go as large as possible
251 maintaining aspect ratio */
252 if (screenAspect > desktopAspect) {
253 width = viewer->desktopHeight * desktopAspect;
254 height = viewer->desktopHeight;
255 } else {
256 width = viewer->desktopWidth;
257 height = viewer->desktopWidth / desktopAspect;
258 }
259 } else {
260 width = viewer->desktopWidth;
261 height = viewer->desktopHeight;
262 }
263
264 SCALE(width);
265 SCALE(height);
266
267 viewer_set_widget_size(viewer,
268 glade_xml_get_widget(viewer->glade, "display-align"),
269 width,
270 height);
271 }
272
273 static void viewer_menu_view_zoom_out(G_GNUC_UNUSED GtkWidget *menu, VirtViewer *viewer)
274 {
275 viewer->zoomlevel -= 10;
276 if (viewer->zoomlevel < 10)
277 viewer->zoomlevel = 10;
278
279 viewer_resize_main_window(viewer);
280 }
281
282 static void viewer_menu_view_zoom_in(G_GNUC_UNUSED GtkWidget *menu, VirtViewer *viewer)
283 {
284 viewer->zoomlevel += 10;
285 if (viewer->zoomlevel > 200)
286 viewer->zoomlevel = 200;
287
288 viewer_resize_main_window(viewer);
289 }
290
291 static void viewer_menu_view_zoom_reset(G_GNUC_UNUSED GtkWidget *menu, VirtViewer *viewer)
292 {
293 viewer->zoomlevel = 100;
294
295 viewer_resize_main_window(viewer);
296 }
297
298 void viewer_set_title(VirtViewer *viewer, gboolean grabbed)
299 {
300 char *title;
301 const char *subtitle;
302
303 if (!viewer->window)
304 return;
305
306 if (grabbed)
307 subtitle = "(Press Ctrl+Alt to release pointer) ";
308 else
309 subtitle = "";
310
311 title = g_strdup_printf("%s%s - Virt Viewer",
312 subtitle, viewer->domtitle);
313
314 gtk_window_set_title(GTK_WINDOW(viewer->window), title);
315
316 g_free(title);
317 }
318
319 static gboolean viewer_ignore_accel(GtkWidget *menu G_GNUC_UNUSED,
320 VirtViewer *viewer G_GNUC_UNUSED)
321 {
322 /* ignore accelerator */
323 return TRUE;
324 }
325
326
327 void viewer_disable_modifiers(VirtViewer *viewer)
328 {
329 GtkSettings *settings = gtk_settings_get_default();
330 GValue empty;
331 GSList *accels;
332 int i;
333
334 if (!viewer->window)
335 return;
336
337 if (!viewer->accelEnabled)
338 return;
339
340 /* This stops F10 activating menu bar */
341 memset(&empty, 0, sizeof empty);
342 g_value_init(&empty, G_TYPE_STRING);
343 g_object_get_property(G_OBJECT(settings), "gtk-menu-bar-accel", &viewer->accelSetting);
344 g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &empty);
345
346 /* This stops global accelerators like Ctrl+Q == Quit */
347 for (accels = viewer->accelList ; accels ; accels = accels->next) {
348 gtk_window_remove_accel_group(GTK_WINDOW(viewer->window), accels->data);
349 }
350
351 /* This stops menu bar shortcuts like Alt+F == File */
352 for (i = 0 ; i < LAST_MENU ; i++) {
353 GtkWidget *menu = glade_xml_get_widget(viewer->glade, menuNames[i]);
354 viewer->accelMenuSig[i] =
355 g_signal_connect(menu, "mnemonic-activate",
356 G_CALLBACK(viewer_ignore_accel), viewer);
357 }
358
359 viewer->accelEnabled = FALSE;
360 }
361
362
363 void viewer_enable_modifiers(VirtViewer *viewer)
364 {
365 GtkSettings *settings = gtk_settings_get_default();
366 GSList *accels;
367 int i;
368
369 if (!viewer->window)
370 return;
371
372 if (viewer->accelEnabled)
373 return;
374
375 /* This allows F10 activating menu bar */
376 g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &viewer->accelSetting);
377
378 /* This allows global accelerators like Ctrl+Q == Quit */
379 for (accels = viewer->accelList ; accels ; accels = accels->next) {
380 gtk_window_add_accel_group(GTK_WINDOW(viewer->window), accels->data);
381 }
382
383 /* This allows menu bar shortcuts like Alt+F == File */
384 for (i = 0 ; i < LAST_MENU ; i++) {
385 GtkWidget *menu = glade_xml_get_widget(viewer->glade, menuNames[i]);
386 g_signal_handler_disconnect(menu, viewer->accelMenuSig[i]);
387 }
388
389 viewer->accelEnabled = TRUE;
390 }
391
392 void viewer_quit(VirtViewer *viewer)
393 {
394 g_return_if_fail(viewer != NULL);
395
396 if (viewer->display)
397 virt_viewer_display_close(viewer->display);
398 gtk_main_quit();
399 }
400
401 static void viewer_delete(GtkWidget *src G_GNUC_UNUSED, void *dummy G_GNUC_UNUSED, VirtViewer *viewer)
402 {
403 viewer_quit(viewer);
404 }
405
406 static void viewer_menu_file_quit(GtkWidget *src G_GNUC_UNUSED, VirtViewer *viewer)
407 {
408 viewer_quit(viewer);
409 }
410
411 static void viewer_menu_view_fullscreen(GtkWidget *menu, VirtViewer *viewer)
412 {
413 if (!viewer->window)
414 return;
415
416 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) {
417 viewer->fullscreen = TRUE;
418 gtk_window_fullscreen(GTK_WINDOW(viewer->window));
419 } else {
420 viewer->fullscreen = FALSE;
421 gtk_window_unfullscreen(GTK_WINDOW(viewer->window));
422 if (viewer->autoResize)
423 viewer_resize_main_window(viewer);
424 }
425 }
426
427 static void viewer_menu_view_resize(GtkWidget *menu, VirtViewer *viewer)
428 {
429 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) {
430 viewer->autoResize = TRUE;
431 if (!viewer->fullscreen)
432 viewer_resize_main_window(viewer);
433 } else {
434 viewer->autoResize = FALSE;
435 }
436 }
437
438 static void viewer_menu_send(GtkWidget *menu G_GNUC_UNUSED, VirtViewer *viewer)
439 {
440 int i;
441 GtkWidget *label = gtk_bin_get_child(GTK_BIN(menu));
442 const char *text = gtk_label_get_label(GTK_LABEL(label));
443
444 for (i = 0 ; i < G_N_ELEMENTS(keyCombos) ; i++) {
445 if (!strcmp(text, keyCombos[i].label)) {
446 DEBUG_LOG("Sending key combo %s", gtk_label_get_text(GTK_LABEL(label)));
447 virt_viewer_display_send_keys(viewer->display,
448 keyCombos[i].keys,
449 keyCombos[i].nkeys);
450 return;
451 }
452 }
453 DEBUG_LOG("Failed to find key combo %s", gtk_label_get_text(GTK_LABEL(label)));
454 }
455
456
457 static void viewer_save_screenshot(VirtViewer *viewer, const char *file)
458 {
459 GdkPixbuf *pix = virt_viewer_display_get_pixbuf(viewer->display);
460 gdk_pixbuf_save(pix, file, "png", NULL,
461 "tEXt::Generator App", PACKAGE, NULL);
462 gdk_pixbuf_unref(pix);
463 }
464
465 static void viewer_menu_file_screenshot(GtkWidget *menu G_GNUC_UNUSED, VirtViewer *viewer)
466 {
467 GtkWidget *dialog;
468
469 g_return_if_fail(viewer->display != NULL);
470
471 dialog = gtk_file_chooser_dialog_new ("Save screenshot",
472 NULL,
473 GTK_FILE_CHOOSER_ACTION_SAVE,
474 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
475 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
476 NULL);
477 gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
478
479 //gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), default_folder_for_saving);
480 //gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "Screenshot");
481
482 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
483 char *filename;
484
485 filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
486 viewer_save_screenshot(viewer, filename);
487 g_free (filename);
488 }
489
490 gtk_widget_destroy (dialog);
491 }
492
493 static void viewer_about_close(GtkWidget *dialog, VirtViewer *viewer G_GNUC_UNUSED)
494 {
495 gtk_widget_hide(dialog);
496 gtk_widget_destroy(dialog);
497 }
498
499 static void viewer_about_delete(GtkWidget *dialog, void *dummy G_GNUC_UNUSED, VirtViewer *viewer G_GNUC_UNUSED)
500 {
501 gtk_widget_hide(dialog);
502 gtk_widget_destroy(dialog);
503 }
504
505 static void viewer_menu_help_about(GtkWidget *menu G_GNUC_UNUSED, VirtViewer *viewer)
506 {
507 GladeXML *about;
508 GtkWidget *dialog;
509
510 about = viewer_load_glade("about.glade", "about");
511
512 dialog = glade_xml_get_widget(about, "about");
513 gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), VERSION);
514 glade_xml_signal_connect_data(about, "about_delete",
515 G_CALLBACK(viewer_about_delete), viewer);
516 glade_xml_signal_connect_data(about, "about_close",
517 G_CALLBACK(viewer_about_close), viewer);
518
519 gtk_widget_show_all(dialog);
520
521 g_object_unref(G_OBJECT(about));
522 }
523
524
525
526 static int viewer_parse_uuid(const char *name, unsigned char *uuid)
527 {
528 int i;
529
530 const char *cur = name;
531 for (i = 0;i < 16;) {
532 uuid[i] = 0;
533 if (*cur == 0)
534 return -1;
535 if ((*cur == '-') || (*cur == ' ')) {
536 cur++;
537 continue;
538 }
539 if ((*cur >= '0') && (*cur <= '9'))
540 uuid[i] = *cur - '0';
541 else if ((*cur >= 'a') && (*cur <= 'f'))
542 uuid[i] = *cur - 'a' + 10;
543 else if ((*cur >= 'A') && (*cur <= 'F'))
544 uuid[i] = *cur - 'A' + 10;
545 else
546 return -1;
547 uuid[i] *= 16;
548 cur++;
549 if (*cur == 0)
550 return -1;
551 if ((*cur >= '0') && (*cur <= '9'))
552 uuid[i] += *cur - '0';
553 else if ((*cur >= 'a') && (*cur <= 'f'))
554 uuid[i] += *cur - 'a' + 10;
555 else if ((*cur >= 'A') && (*cur <= 'F'))
556 uuid[i] += *cur - 'A' + 10;
557 else
558 return -1;
559 i++;
560 cur++;
561 }
562
563 return 0;
564 }
565
566
567 static virDomainPtr viewer_lookup_domain(VirtViewer *viewer)
568 {
569 char *end;
570 int id = strtol(viewer->domkey, &end, 10);
571 virDomainPtr dom = NULL;
572 unsigned char uuid[16];
573
574 if (id >= 0 && end && !*end) {
575 dom = virDomainLookupByID(viewer->conn, id);
576 }
577 if (!dom && viewer_parse_uuid(viewer->domkey, uuid) == 0) {
578 dom = virDomainLookupByUUID(viewer->conn, uuid);
579 }
580 if (!dom) {
581 dom = virDomainLookupByName(viewer->conn, viewer->domkey);
582 }
583 return dom;
584 }
585
586 static int viewer_matches_domain(VirtViewer *viewer,
587 virDomainPtr dom)
588 {
589 char *end;
590 const char *name;
591 int id = strtol(viewer->domkey, &end, 10);
592 unsigned char wantuuid[16];
593 unsigned char domuuid[16];
594
595 if (id >= 0 && end && !*end) {
596 if (virDomainGetID(dom) == id)
597 return 1;
598 }
599 if (viewer_parse_uuid(viewer->domkey, wantuuid) == 0) {
600 virDomainGetUUID(dom, domuuid);
601 if (memcmp(wantuuid, domuuid, VIR_UUID_BUFLEN) == 0)
602 return 1;
603 }
604
605 name = virDomainGetName(dom);
606 if (strcmp(name, viewer->domkey) == 0)
607 return 1;
608
609 return 0;
610 }
611
612 static char * viewer_extract_xpath_string(const gchar *xmldesc, const gchar *xpath)
613 {
614 xmlDocPtr xml = NULL;
615 xmlParserCtxtPtr pctxt = NULL;
616 xmlXPathContextPtr ctxt = NULL;
617 xmlXPathObjectPtr obj = NULL;
618 char *port = NULL;
619
620 pctxt = xmlNewParserCtxt();
621 if (!pctxt || !pctxt->sax)
622 goto error;
623
624 xml = xmlCtxtReadDoc(pctxt, (const xmlChar *)xmldesc, "domain.xml", NULL,
625 XML_PARSE_NOENT | XML_PARSE_NONET |
626 XML_PARSE_NOWARNING);
627 if (!xml)
628 goto error;
629
630 ctxt = xmlXPathNewContext(xml);
631 if (!ctxt)
632 goto error;
633
634 obj = xmlXPathEval((const xmlChar *)xpath, ctxt);
635 if (!obj || obj->type != XPATH_STRING || !obj->stringval || !obj->stringval[0])
636 goto error;
637 if (!strcmp((const char*)obj->stringval, "-1"))
638 goto error;
639
640 port = g_strdup((const char*)obj->stringval);
641 xmlXPathFreeObject(obj);
642 obj = NULL;
643
644 error:
645 if (obj)
646 xmlXPathFreeObject(obj);
647 if (ctxt)
648 xmlXPathFreeContext(ctxt);
649 if (xml)
650 xmlFreeDoc(xml);
651 if (pctxt)
652 xmlFreeParserCtxt(pctxt);
653 return port;
654 }
655
656
657 static int viewer_extract_host(const char *uristr, char **host, char **transport, char **user, int *port)
658 {
659 xmlURIPtr uri;
660 char *offset;
661
662 *host = NULL;
663 *transport = NULL;
664 *user = NULL;
665
666 if (uristr == NULL ||
667 !g_strcasecmp(uristr, "xen"))
668 uristr = "xen:///";
669
670 uri = xmlParseURI(uristr);
671 if (!uri || !uri->server) {
672 *host = g_strdup("localhost");
673 } else {
674 *host = g_strdup(uri->server);
675 }
676
677 if (uri->user)
678 *user = g_strdup(uri->user);
679 *port = uri->port;
680
681 offset = strchr(uri->scheme, '+');
682 if (offset)
683 *transport = g_strdup(offset+1);
684
685 xmlFreeURI(uri);
686 return 0;
687 }
688
689 #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
690
691 static int viewer_open_tunnel(const char **cmd)
692 {
693 int fd[2];
694 pid_t pid;
695
696 if (socketpair(PF_UNIX, SOCK_STREAM, 0, fd) < 0)
697 return -1;
698
699 pid = fork();
700 if (pid == -1) {
701 close(fd[0]);
702 close(fd[1]);
703 return -1;
704 }
705
706 if (pid == 0) { /* child */
707 close(fd[0]);
708 close(0);
709 close(1);
710 if (dup(fd[1]) < 0)
711 _exit(1);
712 if (dup(fd[1]) < 0)
713 _exit(1);
714 close(fd[1]);
715 execvp("ssh", (char *const*)cmd);
716 _exit(1);
717 }
718 close(fd[1]);
719 return fd[0];
720 }
721
722
723 static int viewer_open_tunnel_ssh(const char *sshhost, int sshport, const char *sshuser,
724 const char *port, const char *unixsock)
725 {
726 const char *cmd[10];
727 char portstr[50];
728 int n = 0;
729
730 if (!sshport)
731 sshport = 22;
732
733 sprintf(portstr, "%d", sshport);
734
735 cmd[n++] = "ssh";
736 cmd[n++] = "-p";
737 cmd[n++] = portstr;
738 if (sshuser) {
739 cmd[n++] = "-l";
740 cmd[n++] = sshuser;
741 }
742 cmd[n++] = sshhost;
743 cmd[n++] = "nc";
744 if (port) {
745 cmd[n++] = "localhost";
746 cmd[n++] = port;
747 } else {
748 cmd[n++] = "-U";
749 cmd[n++] = unixsock;
750 }
751 cmd[n++] = NULL;
752
753 return viewer_open_tunnel(cmd);
754 }
755
756 static int viewer_open_unix_sock(const char *unixsock)
757 {
758 struct sockaddr_un addr;
759 int fd;
760
761 memset(&addr, 0, sizeof addr);
762 addr.sun_family = AF_UNIX;
763 strcpy(addr.sun_path, unixsock);
764
765 if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
766 return -1;
767
768 if (connect(fd, (struct sockaddr *)&addr, sizeof addr) < 0) {
769 close(fd);
770 return -1;
771 }
772
773 return fd;
774 }
775
776 #endif /* defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK) */
777
778 void viewer_set_status(VirtViewer *viewer, const char *text)
779 {
780 GtkWidget *status, *notebook;
781
782 notebook = glade_xml_get_widget(viewer->glade, "notebook");
783 status = glade_xml_get_widget(viewer->glade, "status");
784
785 gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);
786 gtk_label_set_text(GTK_LABEL(status), text);
787 }
788
789
790 static void viewer_show_display(VirtViewer *viewer)
791 {
792 GtkWidget *notebook;
793
794 g_return_if_fail(viewer != NULL);
795 g_return_if_fail(viewer->display != NULL);
796 g_return_if_fail(viewer->display->widget != NULL);
797
798 notebook = glade_xml_get_widget(viewer->glade, "notebook");
799 gtk_widget_show(viewer->display->widget);
800 gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook),
801 viewer->display->need_align ? 1 : 2);
802 }
803
804 static void viewer_connect_info_free(VirtViewer *viewer)
805 {
806 free(viewer->host);
807 free(viewer->gport);
808 free(viewer->transport);
809 free(viewer->user);
810
811 viewer->host = NULL;
812 viewer->gport = NULL;
813 viewer->transport = NULL;
814 viewer->user = NULL;
815 viewer->port = 0;
816 }
817
818 static gboolean viewer_extract_connect_info(VirtViewer *viewer,
819 virDomainPtr dom)
820 {
821 char *type = NULL;
822 char *xpath = NULL;
823 gboolean retval = FALSE;
824 char *xmldesc = virDomainGetXMLDesc(dom, 0);
825
826 viewer_connect_info_free(viewer);
827
828 if ((type = viewer_extract_xpath_string(xmldesc, "string(/domain/devices/graphics/@type)")) == NULL) {
829 viewer_simple_message_dialog(viewer->window, _("Cannot determine the graphic type for the guest %s"),
830 viewer->domkey);
831 goto cleanup;
832 }
833
834 if (g_strcasecmp(type, "vnc") == 0)
835 viewer->display = VIRT_VIEWER_DISPLAY(virt_viewer_display_vnc_new(viewer));
836 #ifdef HAVE_SPICE_GTK
837 else if (g_strcasecmp(type, "spice") == 0)
838 viewer->display = VIRT_VIEWER_DISPLAY(virt_viewer_display_spice_new(viewer));
839 #endif
840 else {
841 viewer_simple_message_dialog(viewer->window, _("Unknown graphic type for the guest %s"),
842 viewer->domkey);
843 goto cleanup;
844 }
845
846 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@port)", type);
847 if ((viewer->gport = viewer_extract_xpath_string(xmldesc, xpath)) == NULL) {
848 free(xpath);
849 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@socket)", type);
850 if ((viewer->unixsock = viewer_extract_xpath_string(xmldesc, xpath)) == NULL) {
851 viewer_simple_message_dialog(viewer->window, _("Cannot determine the graphic address for the guest %s"),
852 viewer->domkey);
853 goto cleanup;
854 }
855 }
856
857 DEBUG_LOG("Guest graphics address is %s", viewer->gport ? viewer->gport : viewer->unixsock);
858
859 if (viewer_extract_host(viewer->uri, &viewer->host, &viewer->transport, &viewer->user, &viewer->port) < 0) {
860 viewer_simple_message_dialog(viewer->window, _("Cannot determine the host for the guest %s"),
861 viewer->domkey);
862 goto cleanup;
863 }
864
865 retval = TRUE;
866
867 cleanup:
868 free(xpath);
869 free(xmldesc);
870 return retval;
871 }
872
873 void viewer_channel_open_fd(VirtViewer *viewer, VirtViewerDisplayChannel *channel)
874 {
875 #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
876 int fd = -1;
877
878 g_return_if_fail(viewer != NULL);
879 g_return_if_fail(viewer->display != NULL);
880
881 if (viewer->transport && g_strcasecmp(viewer->transport, "ssh") == 0 &&
882 !viewer->direct) {
883 if ((fd = viewer_open_tunnel_ssh(viewer->host, viewer->port, viewer->user, viewer->gport, NULL)) < 0)
884 viewer_simple_message_dialog(viewer->window, _("Connect to ssh failed."));
885 } else
886 viewer_simple_message_dialog(viewer->window, _("Can't connect to channel, SSH only supported."));
887
888 if (fd >= 0)
889 virt_viewer_display_channel_open_fd(viewer->display, channel, fd);
890 #else
891 viewer_simple_message_dialog(viewer->window, _("Connect to channel unsupported."));
892 #endif
893 }
894
895 static int viewer_activate(VirtViewer *viewer,
896 virDomainPtr dom)
897 {
898 int fd = -1;
899 int ret = -1;
900
901 g_return_val_if_fail(viewer->display == NULL, -1);
902
903 if (viewer->active)
904 goto cleanup;
905
906 if (!viewer_extract_connect_info(viewer, dom))
907 goto cleanup;
908
909 if (viewer->gport)
910 viewer->pretty_address = g_strdup_printf("%s:%s", viewer->host, viewer->gport);
911 else
912 viewer->pretty_address = g_strdup_printf("%s:%s", viewer->host, viewer->unixsock);
913
914 #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
915 if (viewer->transport &&
916 g_strcasecmp(viewer->transport, "ssh") == 0 &&
917 !viewer->direct) {
918 DEBUG_LOG("Opening SSH tunnel to %s@%s:%d (%s)",
919 viewer->user, viewer->host,
920 viewer->port, viewer->gport ? viewer->gport : viewer->unixsock);
921 if ((fd = viewer_open_tunnel_ssh(viewer->host, viewer->port,
922 viewer->user, viewer->gport, viewer->unixsock)) < 0)
923 return -1;
924 } else if (viewer->unixsock) {
925 DEBUG_LOG("Connecting to UNIX socket %s", viewer->unixsock);
926 if ((fd = viewer_open_unix_sock(viewer->unixsock)) < 0)
927 return -1;
928 }
929 #endif
930
931 if (fd >= 0) {
932 DEBUG_LOG("Connecting to tunnel %d", fd);
933 ret = virt_viewer_display_open_fd(viewer->display, fd);
934 } else {
935 DEBUG_LOG("Connecting to TCP socket %s:%s", viewer->host, viewer->gport);
936 ret = virt_viewer_display_open_host(viewer->display,
937 viewer->host, viewer->gport);
938 }
939
940 viewer_set_status(viewer, "Connecting to graphic server");
941
942 free(viewer->domtitle);
943 viewer->domtitle = g_strdup(virDomainGetName(dom));
944
945 viewer->connected = FALSE;
946 viewer->active = TRUE;
947 viewer_set_title(viewer, FALSE);
948
949 cleanup:
950 return ret;
951 }
952
953 /* text was actually requested */
954 static void viewer_vnc_clipboard_copy(GtkClipboard *clipboard G_GNUC_UNUSED,
955 GtkSelectionData *data,
956 guint info G_GNUC_UNUSED,
957 VirtViewer *viewer)
958 {
959 gtk_selection_data_set_text(data, viewer->clipboard, -1);
960 }
961
962 void viewer_server_cut_text(VirtViewer *viewer, const gchar *text)
963 {
964 GtkClipboard *cb;
965 gsize a, b;
966 GtkTargetEntry targets[] = {
967 {g_strdup("UTF8_STRING"), 0, 0},
968 {g_strdup("COMPOUND_TEXT"), 0, 0},
969 {g_strdup("TEXT"), 0, 0},
970 {g_strdup("STRING"), 0, 0},
971 };
972
973 if (!text)
974 return;
975
976 g_free (viewer->clipboard);
977 viewer->clipboard = g_convert (text, -1, "utf-8", "iso8859-1", &a, &b, NULL);
978
979 if (viewer->clipboard) {
980 cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
981
982 gtk_clipboard_set_with_owner (cb,
983 targets,
984 G_N_ELEMENTS(targets),
985 (GtkClipboardGetFunc)viewer_vnc_clipboard_copy,
986 NULL,
987 G_OBJECT (viewer));
988 }
989 }
990
991 static gboolean viewer_retryauth(gpointer opaque)
992 {
993 VirtViewer *viewer = opaque;
994 viewer_initial_connect(viewer);
995
996 return FALSE;
997 }
998
999 static void viewer_deactivate(VirtViewer *viewer)
1000 {
1001 if (!viewer->active)
1002 return;
1003
1004 if (viewer->display)
1005 virt_viewer_display_close(viewer->display);
1006 free(viewer->domtitle);
1007 viewer->domtitle = NULL;
1008
1009 viewer->connected = FALSE;
1010 viewer->active = FALSE;
1011 g_free(viewer->pretty_address);
1012 viewer->pretty_address = NULL;
1013 viewer_set_title(viewer, FALSE);
1014
1015 if (viewer->authretry) {
1016 viewer->authretry = FALSE;
1017 g_idle_add(viewer_retryauth, viewer);
1018 } else if (viewer->reconnect) {
1019 if (!viewer->withEvents) {
1020 DEBUG_LOG("No domain events, falling back to polling");
1021 g_timeout_add(500,
1022 viewer_connect_timer,
1023 viewer);
1024 }
1025
1026 viewer_set_status(viewer, "Waiting for guest domain to re-start");
1027 } else {
1028 viewer_set_status(viewer, "Guest domain has shutdown");
1029 gtk_main_quit();
1030 }
1031 }
1032
1033 void viewer_connected(VirtViewer *viewer)
1034 {
1035 viewer->connected = TRUE;
1036 viewer_set_status(viewer, "Connected to graphic server");
1037 }
1038
1039 void viewer_initialized(VirtViewer *viewer)
1040 {
1041 viewer_show_display(viewer);
1042 viewer_set_title(viewer, FALSE);
1043 }
1044
1045 void viewer_disconnected(VirtViewer *viewer)
1046 {
1047 if (!viewer->connected) {
1048 viewer_simple_message_dialog(viewer->window, _("Unable to connect to the graphic server %s"),
1049 viewer->pretty_address);
1050 }
1051 viewer_deactivate(viewer);
1052 }
1053
1054
1055 static int viewer_domain_event(virConnectPtr conn G_GNUC_UNUSED,
1056 virDomainPtr dom,
1057 int event,
1058 int detail G_GNUC_UNUSED,
1059 void *opaque)
1060 {
1061 VirtViewer *viewer = opaque;
1062
1063 DEBUG_LOG("Got domain event %d %d", event, detail);
1064
1065 if (!viewer_matches_domain(viewer, dom))
1066 return 0;
1067
1068 switch (event) {
1069 case VIR_DOMAIN_EVENT_STOPPED:
1070 viewer_deactivate(viewer);
1071 break;
1072
1073 case VIR_DOMAIN_EVENT_STARTED:
1074 viewer_activate(viewer, dom);
1075 break;
1076 }
1077
1078 return 0;
1079 }
1080
1081
1082 static int viewer_initial_connect(VirtViewer *viewer)
1083 {
1084 virDomainPtr dom = NULL;
1085 virDomainInfo info;
1086 int ret = -1;
1087
1088 viewer_set_status(viewer, "Finding guest domain");
1089 dom = viewer_lookup_domain(viewer);
1090 if (!dom) {
1091 if (viewer->waitvm) {
1092 viewer_set_status(viewer, "Waiting for guest domain to be created");
1093 goto done;
1094 } else {
1095 viewer_simple_message_dialog(viewer->window, _("Cannot find guest domain %s"),
1096 viewer->domkey);
1097 DEBUG_LOG("Cannot find guest %s", viewer->domkey);
1098 goto cleanup;
1099 }
1100 }
1101
1102 viewer_set_status(viewer, "Checking guest domain status");
1103 if (virDomainGetInfo(dom, &info) < 0) {
1104 DEBUG_LOG("Cannot get guest state");
1105 goto cleanup;
1106 }
1107
1108 if (info.state == VIR_DOMAIN_SHUTOFF) {
1109 viewer_set_status(viewer, "Waiting for guest domain to start");
1110 } else {
1111 ret = viewer_activate(viewer, dom);
1112 if (ret < 0) {
1113 if (viewer->waitvm) {
1114 viewer_set_status(viewer, "Waiting for guest domain to start server");
1115 } else {
1116 DEBUG_LOG("Failed to activate viewer");
1117 goto cleanup;
1118 }
1119 } else if (ret == 0) {
1120 DEBUG_LOG("Failed to activate viewer");
1121 ret = -1;
1122 goto cleanup;
1123 }
1124 }
1125
1126 done:
1127 ret = 0;
1128 cleanup:
1129 if (dom)
1130 virDomainFree(dom);
1131 return ret;
1132 }
1133
1134 static gboolean viewer_connect_timer(void *opaque)
1135 {
1136 VirtViewer *viewer = opaque;
1137
1138 DEBUG_LOG("Connect timer fired");
1139
1140 if (!viewer->active &&
1141 viewer_initial_connect(viewer) < 0)
1142 gtk_main_quit();
1143
1144 if (viewer->active)
1145 return FALSE;
1146
1147 return TRUE;
1148 }
1149
1150 static void viewer_error_func (void *data G_GNUC_UNUSED, virErrorPtr error G_GNUC_UNUSED)
1151 {
1152 /* nada */
1153 }
1154
1155 int
1156 viewer_start (const char *uri,
1157 const char *name,
1158 gint zoom,
1159 gboolean direct,
1160 gboolean waitvm,
1161 gboolean reconnect,
1162 gboolean verbose,
1163 gboolean debug,
1164 GtkWidget *container)
1165 {
1166 VirtViewer *viewer;
1167 GtkWidget *notebook;
1168 GtkWidget *menu;
1169 int cred_types[] =
1170 { VIR_CRED_AUTHNAME, VIR_CRED_PASSPHRASE };
1171 virConnectAuth auth_libvirt = {
1172 .credtype = cred_types,
1173 .ncredtype = ARRAY_CARDINALITY(cred_types),
1174 .cb = viewer_auth_libvirt_credentials,
1175 .cbdata = (void *)uri,
1176 };
1177
1178 doDebug = debug;
1179
1180 viewer = g_new0(VirtViewer, 1);
1181
1182 viewer->active = FALSE;
1183 viewer->autoResize = TRUE;
1184 viewer->direct = direct;
1185 viewer->waitvm = waitvm;
1186 viewer->reconnect = reconnect;
1187 viewer->verbose = verbose;
1188 viewer->domkey = g_strdup(name);
1189 viewer->uri = g_strdup(uri);
1190 viewer->zoomlevel = zoom;
1191
1192 g_value_init(&viewer->accelSetting, G_TYPE_STRING);
1193
1194 viewer_event_register();
1195
1196 virSetErrorFunc(NULL, viewer_error_func);
1197
1198 viewer->conn = virConnectOpenAuth(uri,
1199 //virConnectAuthPtrDefault,
1200 &auth_libvirt,
1201 VIR_CONNECT_RO);
1202 if (!viewer->conn) {
1203 viewer_simple_message_dialog(NULL, _("Unable to connect to libvirt with URI %s"),
1204 uri ? uri : _("[none]"));
1205 return -1;
1206 }
1207
1208 if (!(viewer->glade = viewer_load_glade("viewer.glade",
1209 container ? "notebook" : "viewer")))
1210 return -1;
1211
1212 menu = glade_xml_get_widget(viewer->glade, "menu-view-resize");
1213 if (!container)
1214 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
1215
1216 glade_xml_signal_connect_data(viewer->glade, "viewer_menu_file_quit",
1217 G_CALLBACK(viewer_menu_file_quit), viewer);
1218 glade_xml_signal_connect_data(viewer->glade, "viewer_menu_file_screenshot",
1219 G_CALLBACK(viewer_menu_file_screenshot), viewer);
1220 glade_xml_signal_connect_data(viewer->glade, "viewer_menu_view_fullscreen",
1221 G_CALLBACK(viewer_menu_view_fullscreen), viewer);
1222 glade_xml_signal_connect_data(viewer->glade, "viewer_menu_view_zoom_in",
1223 G_CALLBACK(viewer_menu_view_zoom_in), viewer);
1224 glade_xml_signal_connect_data(viewer->glade, "viewer_menu_view_zoom_out",
1225 G_CALLBACK(viewer_menu_view_zoom_out), viewer);
1226 glade_xml_signal_connect_data(viewer->glade, "viewer_menu_view_zoom_reset",
1227 G_CALLBACK(viewer_menu_view_zoom_reset), viewer);
1228 glade_xml_signal_connect_data(viewer->glade, "viewer_menu_view_resize",
1229 G_CALLBACK(viewer_menu_view_resize), viewer);
1230 glade_xml_signal_connect_data(viewer->glade, "viewer_menu_send",
1231 G_CALLBACK(viewer_menu_send), viewer);
1232 glade_xml_signal_connect_data(viewer->glade, "viewer_menu_help_about",
1233 G_CALLBACK(viewer_menu_help_about), viewer);
1234
1235
1236 notebook = glade_xml_get_widget(viewer->glade, "notebook");
1237 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE);
1238
1239 if (container) {
1240 viewer->container = container;
1241 } else {
1242 GtkWidget *window = glade_xml_get_widget(viewer->glade, "viewer");
1243 GSList *accels;
1244 viewer->container = window;
1245 viewer->window = window;
1246 g_signal_connect(window, "delete-event",
1247 G_CALLBACK(viewer_delete), viewer);
1248 gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
1249 viewer->accelEnabled = TRUE;
1250 accels = gtk_accel_groups_from_object(G_OBJECT(window));
1251 for ( ; accels ; accels = accels->next) {
1252 viewer->accelList = g_slist_append(viewer->accelList, accels->data);
1253 g_object_ref(G_OBJECT(accels->data));
1254 }
1255 gtk_widget_show_all(viewer->window);
1256 }
1257
1258 if (viewer_initial_connect(viewer) < 0)
1259 return -1;
1260
1261 if (virConnectDomainEventRegister(viewer->conn,
1262 viewer_domain_event,
1263 viewer,
1264 NULL) < 0)
1265 viewer->withEvents = FALSE;
1266 else
1267 viewer->withEvents = TRUE;
1268
1269 if (!viewer->withEvents &&
1270 !viewer->active) {
1271 DEBUG_LOG("No domain events, falling back to polling");
1272 g_timeout_add(500,
1273 viewer_connect_timer,
1274 viewer);
1275 }
1276
1277 return 0;
1278 }
1279
1280
1281 /*
1282 * Local variables:
1283 * c-indent-level: 8
1284 * c-basic-offset: 8
1285 * tab-width: 8
1286 * End:
1287 */
+0
-360
src/viewer.glade less more
0 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
2 <!--Generated with glade3 3.4.5 on Wed Nov 26 17:35:24 2008 -->
3 <glade-interface>
4 <widget class="GtkWindow" id="viewer">
5 <property name="default_width">400</property>
6 <property name="default_height">400</property>
7 <child>
8 <widget class="GtkVBox" id="vbox1">
9 <property name="visible">True</property>
10 <child>
11 <widget class="GtkMenuBar" id="top-menu">
12 <property name="visible">True</property>
13 <child>
14 <widget class="GtkMenuItem" id="menu-file">
15 <property name="visible">True</property>
16 <property name="label" translatable="yes">_File</property>
17 <property name="use_underline">True</property>
18 <child>
19 <widget class="GtkMenu" id="menu1">
20 <property name="visible">True</property>
21 <child>
22 <widget class="GtkMenuItem" id="menu-file-screenshot">
23 <property name="visible">True</property>
24 <property name="label" translatable="yes">Screenshot</property>
25 <property name="use_underline">True</property>
26 <signal name="activate" handler="viewer_menu_file_screenshot"/>
27 </widget>
28 </child>
29 <child>
30 <widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
31 <property name="visible">True</property>
32 </widget>
33 </child>
34 <child>
35 <widget class="GtkImageMenuItem" id="imagemenuitem5">
36 <property name="visible">True</property>
37 <property name="label" translatable="yes">gtk-quit</property>
38 <property name="use_underline">True</property>
39 <property name="use_stock">True</property>
40 <signal name="activate" handler="viewer_menu_file_quit"/>
41 </widget>
42 </child>
43 </widget>
44 </child>
45 </widget>
46 </child>
47 <child>
48 <widget class="GtkMenuItem" id="menu-view">
49 <property name="visible">True</property>
50 <property name="label" translatable="yes">_View</property>
51 <property name="use_underline">True</property>
52 <child>
53 <widget class="GtkMenu" id="menu2">
54 <property name="visible">True</property>
55 <child>
56 <widget class="GtkCheckMenuItem" id="menu-view-fullscreen">
57 <property name="visible">True</property>
58 <property name="label" translatable="yes">Full screen</property>
59 <property name="use_underline">True</property>
60 <signal name="toggled" handler="viewer_menu_view_fullscreen"/>
61 </widget>
62 </child>
63 <child>
64 <widget class="GtkMenuItem" id="menu-view-zoom">
65 <property name="visible">True</property>
66 <property name="label" translatable="yes">_Zoom</property>
67 <property name="use_underline">True</property>
68 <child>
69 <widget class="GtkMenu" id="menu4">
70 <property name="visible">True</property>
71 <child>
72 <widget class="GtkMenuItem" id="menu-view-zoom-in">
73 <property name="visible">True</property>
74 <property name="label">gtk-zoom-in</property>
75 <property name="use_stock">True</property>
76 <property name="tooltip" translatable="no">Zoom in on virtual machine</property>
77 <signal name="activate" handler="viewer_menu_view_zoom_in"/>
78 <accelerator key="plus" signal="activate" modifiers="GDK_CONTROL_MASK"/>
79 </widget>
80 </child>
81 <child>
82 <widget class="GtkMenuItem" id="menu-view-zoom-out">
83 <property name="visible">True</property>
84 <property name="label">gtk-zoom-out</property>
85 <property name="use_stock">True</property>
86 <property name="tooltip" translatable="no">Zoom out from virtual machine</property>
87 <signal name="activate" handler="viewer_menu_view_zoom_out"/>
88 <accelerator key="minus" signal="activate" modifiers="GDK_CONTROL_MASK"/>
89 </widget>
90 </child>
91 <child>
92 <widget class="GtkSeparatorMenuItem" id="separatormenuitem4">
93 <property name="visible">True</property>
94 </widget>
95 </child>
96 <child>
97 <widget class="GtkMenuItem" id="menu-view-zoom-reset">
98 <property name="visible">True</property>
99 <property name="label">gtk-zoom-100</property>
100 <property name="use_stock">True</property>
101 <property name="tooltip" translatable="no">Reset zoom to normal</property>
102 <signal name="activate" handler="viewer_menu_view_zoom_reset"/>
103 <accelerator key="0" signal="activate" modifiers="GDK_CONTROL_MASK"/>
104 </widget>
105 </child>
106 </widget>
107 </child>
108 </widget>
109 </child>
110 <child>
111 <widget class="GtkCheckMenuItem" id="menu-view-resize">
112 <property name="visible">True</property>
113 <property name="label" translatable="yes">Automatically resize</property>
114 <property name="use_underline">True</property>
115 <signal name="toggled" handler="viewer_menu_view_resize"/>
116 </widget>
117 </child>
118 </widget>
119 </child>
120 </widget>
121 </child>
122 <child>
123 <widget class="GtkMenuItem" id="menu-send">
124 <property name="visible">True</property>
125 <property name="label" translatable="yes">_Send key</property>
126 <property name="use_underline">True</property>
127 <child>
128 <widget class="GtkMenu" id="menu5">
129 <property name="visible">True</property>
130 <child>
131 <widget class="GtkMenuItem" id="menu-send-cad">
132 <property name="visible">True</property>
133 <property name="label" translatable="yes">Ctrl+Alt+_Del</property>
134 <property name="use_underline">True</property>
135 <signal name="activate" handler="viewer_menu_send" object="cad"/>
136 </widget>
137 </child>
138 <child>
139 <widget class="GtkMenuItem" id="menu-send-cab">
140 <property name="visible">True</property>
141 <property name="label" translatable="yes">Ctrl+Alt+_Backspace</property>
142 <property name="use_underline">True</property>
143 <signal name="activate" handler="viewer_menu_send" object="cab"/>
144 </widget>
145 </child>
146 <child>
147 <widget class="GtkSeparatorMenuItem" id="separatormenuitem2">
148 <property name="visible">True</property>
149 </widget>
150 </child>
151 <child>
152 <widget class="GtkMenuItem" id="menu-send-caf1">
153 <property name="visible">True</property>
154 <property name="label" translatable="yes">Ctrl+Alt+F_1</property>
155 <property name="use_underline">True</property>
156 <signal name="activate" handler="viewer_menu_send" object="caf1"/>
157 </widget>
158 </child>
159 <child>
160 <widget class="GtkMenuItem" id="menu-send-caf2">
161 <property name="visible">True</property>
162 <property name="label" translatable="yes">Ctrl+Alt+F_2</property>
163 <property name="use_underline">True</property>
164 <signal name="activate" handler="viewer_menu_send" object="caf2"/>
165 </widget>
166 </child>
167 <child>
168 <widget class="GtkMenuItem" id="menu-send-caf3">
169 <property name="visible">True</property>
170 <property name="label" translatable="yes">Ctrl+Alt+F_3</property>
171 <property name="use_underline">True</property>
172 <signal name="activate" handler="viewer_menu_send" object="caf3"/>
173 </widget>
174 </child>
175 <child>
176 <widget class="GtkMenuItem" id="menu-send-caf4">
177 <property name="visible">True</property>
178 <property name="label" translatable="yes">Ctrl+Alt+F_4</property>
179 <property name="use_underline">True</property>
180 <signal name="activate" handler="viewer_menu_send" object="caf4"/>
181 </widget>
182 </child>
183 <child>
184 <widget class="GtkMenuItem" id="menu-send-caf5">
185 <property name="visible">True</property>
186 <property name="label" translatable="yes">Ctrl+Alt+F_5</property>
187 <property name="use_underline">True</property>
188 <signal name="activate" handler="viewer_menu_send" object="caf5"/>
189 </widget>
190 </child>
191 <child>
192 <widget class="GtkMenuItem" id="menu-send-caf6">
193 <property name="visible">True</property>
194 <property name="label" translatable="yes">Ctrl+Alt+F_6</property>
195 <property name="use_underline">True</property>
196 <signal name="activate" handler="viewer_menu_send"/>
197 </widget>
198 </child>
199 <child>
200 <widget class="GtkMenuItem" id="menu-send-caf7">
201 <property name="visible">True</property>
202 <property name="label" translatable="yes">Ctrl+Alt+F_7</property>
203 <property name="use_underline">True</property>
204 <signal name="activate" handler="viewer_menu_send" object="caf7"/>
205 </widget>
206 </child>
207 <child>
208 <widget class="GtkMenuItem" id="menu-send-caf8">
209 <property name="visible">True</property>
210 <property name="label" translatable="yes">Ctrl+Alt+F_8</property>
211 <property name="use_underline">True</property>
212 <signal name="activate" handler="viewer_menu_send" object="caf8"/>
213 </widget>
214 </child>
215 <child>
216 <widget class="GtkMenuItem" id="menu-send-caf9">
217 <property name="visible">True</property>
218 <property name="label" translatable="yes">Ctrl+Alt+F_9</property>
219 <property name="use_underline">True</property>
220 <signal name="activate" handler="viewer_menu_send" object="caf9"/>
221 </widget>
222 </child>
223 <child>
224 <widget class="GtkMenuItem" id="menu-send-caf10">
225 <property name="visible">True</property>
226 <property name="label" translatable="yes">Ctrl+Alt+F1_0</property>
227 <property name="use_underline">True</property>
228 <signal name="activate" handler="viewer_menu_send" object="caf10"/>
229 </widget>
230 </child>
231 <child>
232 <widget class="GtkMenuItem" id="menu-send-caf11">
233 <property name="visible">True</property>
234 <property name="label" translatable="yes">Ctrl+Alt+F11</property>
235 <property name="use_underline">True</property>
236 <signal name="activate" handler="viewer_menu_send" object="caf11"/>
237 </widget>
238 </child>
239 <child>
240 <widget class="GtkMenuItem" id="menu-send-caf12">
241 <property name="visible">True</property>
242 <property name="label" translatable="yes">Ctrl+Alt+F12</property>
243 <property name="use_underline">True</property>
244 <signal name="activate" handler="viewer_menu_send" object="caf12"/>
245 </widget>
246 </child>
247 <child>
248 <widget class="GtkSeparatorMenuItem" id="separatormenuitem3">
249 <property name="visible">True</property>
250 </widget>
251 </child>
252 <child>
253 <widget class="GtkMenuItem" id="menu-send-print">
254 <property name="visible">True</property>
255 <property name="label" translatable="yes">_PrintScreen</property>
256 <property name="use_underline">True</property>
257 <signal name="activate" handler="viewer_menu_send" object="printscreen"/>
258 </widget>
259 </child>
260 </widget>
261 </child>
262 </widget>
263 </child>
264 <child>
265 <widget class="GtkMenuItem" id="menu-help">
266 <property name="visible">True</property>
267 <property name="label" translatable="yes">_Help</property>
268 <property name="use_underline">True</property>
269 <child>
270 <widget class="GtkMenu" id="menu3">
271 <property name="visible">True</property>
272 <child>
273 <widget class="GtkImageMenuItem" id="imagemenuitem10">
274 <property name="visible">True</property>
275 <property name="label" translatable="yes">gtk-about</property>
276 <property name="use_underline">True</property>
277 <property name="use_stock">True</property>
278 <signal name="activate" handler="viewer_menu_help_about"/>
279 </widget>
280 </child>
281 </widget>
282 </child>
283 </widget>
284 </child>
285 </widget>
286 <packing>
287 <property name="expand">False</property>
288 </packing>
289 </child>
290 <child>
291 <widget class="GtkNotebook" id="notebook">
292 <property name="visible">True</property>
293 <property name="can_focus">True</property>
294 <property name="show_border">False</property>
295 <child>
296 <widget class="GtkLabel" id="status">
297 <property name="visible">True</property>
298 </widget>
299 </child>
300 <child>
301 <widget class="GtkLabel" id="label1">
302 <property name="visible">True</property>
303 <property name="label" translatable="yes">page 1</property>
304 </widget>
305 <packing>
306 <property name="type">tab</property>
307 <property name="tab_fill">False</property>
308 </packing>
309 </child>
310 <child>
311 <widget class="GtkAlignment" id="display-align">
312 <property name="visible">True</property>
313 <property name="xscale">0</property>
314 <property name="yscale">0</property>
315 <child>
316 <placeholder/>
317 </child>
318 </widget>
319 <packing>
320 <property name="position">1</property>
321 </packing>
322 </child>
323 <child>
324 <widget class="GtkLabel" id="label2">
325 <property name="visible">True</property>
326 <property name="label" translatable="yes">page 2</property>
327 </widget>
328 <packing>
329 <property name="type">tab</property>
330 <property name="position">1</property>
331 <property name="tab_fill">False</property>
332 </packing>
333 </child>
334 <child>
335 <placeholder/>
336 <packing>
337 <property name="position">2</property>
338 </packing>
339 </child>
340 <child>
341 <widget class="GtkLabel" id="label3">
342 <property name="visible">True</property>
343 <property name="label" translatable="yes">page 3</property>
344 </widget>
345 <packing>
346 <property name="type">tab</property>
347 <property name="position">2</property>
348 <property name="tab_fill">False</property>
349 </packing>
350 </child>
351 </widget>
352 <packing>
353 <property name="position">1</property>
354 </packing>
355 </child>
356 </widget>
357 </child>
358 </widget>
359 </glade-interface>
+0
-38
src/viewer.h less more
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007 Red Hat,
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #ifndef VIRT_VIEWER_H
23 #define VIRT_VIEWER_H
24
25 #include "util.h"
26
27 extern int viewer_start (const char *uri,
28 const char *name,
29 gint zoom,
30 gboolean direct,
31 gboolean waitvm,
32 gboolean reconnect,
33 gboolean verbose,
34 gboolean debug,
35 GtkWidget *container);
36
37 #endif /* VIRT_VIEWER_H */
0 <?xml version="1.0"?>
1 <interface>
2 <!-- interface-requires gtk+ 2.12 -->
3 <!-- interface-naming-policy toplevel-contextual -->
4 <object class="GtkAboutDialog" id="about">
5 <property name="border_width">5</property>
6 <property name="title" translatable="yes">About Glade</property>
7 <property name="resizable">False</property>
8 <property name="window_position">center-on-parent</property>
9 <property name="type_hint">dialog</property>
10 <property name="program_name">Virtual Machine Viewer</property>
11 <property name="copyright" translatable="yes">Copyright 2007-2008 Daniel P. Berrange
12 Copyright 2007-2008 Red Hat, Inc.</property>
13 <property name="comments" translatable="yes">A remote desktop client built with GTK-VNC and libvirt</property>
14 <property name="website">http://virt-manager.org/</property>
15 <property name="website_label" translatable="yes">virt-manager.org</property>
16 <property name="license" translatable="yes">This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 2 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 </property>
30 <property name="authors">Daniel P. Berrange</property>
31 <property name="translator_credits" translatable="yes">The Fedora Translation Team</property>
32 <signal name="response" handler="virt_viewer_about_close"/>
33 <signal name="delete_event" handler="virt_viewer_about_delete"/>
34 <child internal-child="vbox">
35 <object class="GtkVBox" id="dialog-vbox1">
36 <property name="visible">True</property>
37 <property name="spacing">2</property>
38 <child>
39 <placeholder/>
40 </child>
41 <child internal-child="action_area">
42 <object class="GtkHButtonBox" id="dialog-action_area1">
43 <property name="visible">True</property>
44 <property name="layout_style">end</property>
45 </object>
46 <packing>
47 <property name="expand">False</property>
48 <property name="pack_type">end</property>
49 <property name="position">0</property>
50 </packing>
51 </child>
52 </object>
53 </child>
54 </object>
55 </interface>
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #include <config.h>
23
24 #include <vncdisplay.h>
25 #include <gtk/gtk.h>
26 #include <string.h>
27
28 #include "virt-viewer-auth.h"
29
30
31 int
32 virt_viewer_auth_collect_credentials(const char *type,
33 const char *address,
34 char **username,
35 char **password)
36 {
37 GtkWidget *dialog = NULL;
38 GtkBuilder *creds = virt_viewer_util_load_ui("virt-viewer-auth.xml");
39 GtkWidget *credUsername;
40 GtkWidget *credPassword;
41 GtkWidget *promptUsername;
42 GtkWidget *promptPassword;
43 GtkWidget *labelMessage;
44 int response;
45 char *message;
46
47 dialog = GTK_WIDGET(gtk_builder_get_object(creds, "auth"));
48 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
49
50 labelMessage = GTK_WIDGET(gtk_builder_get_object(creds, "message"));
51 credUsername = GTK_WIDGET(gtk_builder_get_object(creds, "cred-username"));
52 promptUsername = GTK_WIDGET(gtk_builder_get_object(creds, "prompt-username"));
53 credPassword = GTK_WIDGET(gtk_builder_get_object(creds, "cred-password"));
54 promptPassword = GTK_WIDGET(gtk_builder_get_object(creds, "prompt-password"));
55
56 gtk_widget_set_sensitive(credUsername, username != NULL);
57 gtk_widget_set_sensitive(promptUsername, username != NULL);
58 gtk_widget_set_sensitive(credPassword, password != NULL);
59 gtk_widget_set_sensitive(promptPassword, password != NULL);
60
61 if (address) {
62 message = g_strdup_printf("Authentication is required for the %s connection to:\n\n"
63 "<b>%s</b>\n\n",
64 type,
65 address ? address : "[unknown]");
66 } else {
67 message = g_strdup_printf("Authentication is required for the %s connection:\n",
68 type);
69 }
70
71 gtk_label_set_markup(GTK_LABEL(labelMessage), message);
72 g_free(message);
73
74 gtk_widget_show_all(dialog);
75 response = gtk_dialog_run(GTK_DIALOG(dialog));
76 gtk_widget_hide(dialog);
77
78 if (response == GTK_RESPONSE_OK) {
79 if (username)
80 *username = g_strdup(gtk_entry_get_text(GTK_ENTRY(credUsername)));
81 if (password)
82 *password = g_strdup(gtk_entry_get_text(GTK_ENTRY(credPassword)));
83 }
84
85 gtk_widget_destroy(GTK_WIDGET(dialog));
86
87 return response == GTK_RESPONSE_OK ? 0 : -1;
88 }
89
90 void
91 virt_viewer_auth_vnc_credentials(GtkWidget *vnc,
92 GValueArray *credList,
93 char **vncAddress)
94 {
95 char *username = NULL, *password = NULL;
96 gboolean wantPassword = FALSE, wantUsername = FALSE;
97 int i;
98
99 DEBUG_LOG("Got VNC credential request for %d credential(s)", credList->n_values);
100
101 for (i = 0 ; i < credList->n_values ; i++) {
102 GValue *cred = g_value_array_get_nth(credList, i);
103 switch (g_value_get_enum(cred)) {
104 case VNC_DISPLAY_CREDENTIAL_USERNAME:
105 wantUsername = TRUE;
106 break;
107 case VNC_DISPLAY_CREDENTIAL_PASSWORD:
108 wantPassword = TRUE;
109 break;
110 case VNC_DISPLAY_CREDENTIAL_CLIENTNAME:
111 break;
112 default:
113 DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred));
114 vnc_display_close(VNC_DISPLAY(vnc));
115 goto cleanup;
116 }
117 }
118
119 if (wantUsername || wantPassword) {
120 int ret = virt_viewer_auth_collect_credentials("VNC", vncAddress ? *vncAddress : NULL,
121 wantUsername ? &username : NULL,
122 wantPassword ? &password : NULL);
123
124 if (ret < 0) {
125 vnc_display_close(VNC_DISPLAY(vnc));
126 goto cleanup;
127 }
128 }
129
130 for (i = 0 ; i < credList->n_values ; i++) {
131 GValue *cred = g_value_array_get_nth(credList, i);
132 switch (g_value_get_enum(cred)) {
133 case VNC_DISPLAY_CREDENTIAL_USERNAME:
134 if (!username ||
135 vnc_display_set_credential(VNC_DISPLAY(vnc),
136 g_value_get_enum(cred),
137 username)) {
138 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
139 vnc_display_close(VNC_DISPLAY(vnc));
140 }
141 break;
142 case VNC_DISPLAY_CREDENTIAL_PASSWORD:
143 if (!password ||
144 vnc_display_set_credential(VNC_DISPLAY(vnc),
145 g_value_get_enum(cred),
146 password)) {
147 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
148 vnc_display_close(VNC_DISPLAY(vnc));
149 }
150 break;
151 case VNC_DISPLAY_CREDENTIAL_CLIENTNAME:
152 if (vnc_display_set_credential(VNC_DISPLAY(vnc),
153 g_value_get_enum(cred),
154 "libvirt")) {
155 DEBUG_LOG("Failed to set credential type %d", g_value_get_enum(cred));
156 vnc_display_close(VNC_DISPLAY(vnc));
157 }
158 break;
159 default:
160 DEBUG_LOG("Unsupported credential type %d", g_value_get_enum(cred));
161 vnc_display_close(VNC_DISPLAY(vnc));
162 }
163 }
164
165 cleanup:
166 g_free(username);
167 g_free(password);
168 }
169
170
171
172 int
173 virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
174 unsigned int ncred,
175 void *cbdata)
176 {
177 char **username = NULL, **password = NULL;
178 const char *uri = cbdata;
179 int i;
180 int ret = -1;
181
182 DEBUG_LOG("Got libvirt credential request for %d credential(s)", ncred);
183
184 for (i = 0 ; i < ncred ; i++) {
185 switch (cred[i].type) {
186 case VIR_CRED_USERNAME:
187 case VIR_CRED_AUTHNAME:
188 username = &cred[i].result;
189 break;
190 case VIR_CRED_PASSPHRASE:
191 password = &cred[i].result;
192 break;
193 default:
194 DEBUG_LOG("Unsupported libvirt credential %d", cred[i].type);
195 return -1;
196 }
197 }
198
199 if (username || password) {
200 ret = virt_viewer_auth_collect_credentials("libvirt", uri,
201 username, password);
202 if (ret < 0)
203 goto cleanup;
204 } else {
205 ret = 0;
206 }
207
208 for (i = 0 ; i < ncred ; i++) {
209 switch (cred[i].type) {
210 case VIR_CRED_AUTHNAME:
211 case VIR_CRED_USERNAME:
212 case VIR_CRED_PASSPHRASE:
213 if (cred[i].result)
214 cred[i].resultlen = strlen(cred[i].result);
215 else
216 cred[i].resultlen = 0;
217 DEBUG_LOG("Got '%s' %d %d", cred[i].result, cred[i].resultlen, cred[i].type);
218 break;
219 }
220 }
221
222 cleanup:
223 DEBUG_LOG("Return %d", ret);
224 return ret;
225 }
226
227
228
229
230 /*
231 * Local variables:
232 * c-indent-level: 8
233 * c-basic-offset: 8
234 * tab-width: 8
235 * End:
236 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #ifndef VIRT_VIEWER_AUTH_H
23 #define VIRT_VIEWER_AUTH_H
24
25 #include <libvirt/libvirt.h>
26
27 #include "virt-viewer-util.h"
28
29 void virt_viewer_auth_vnc_credentials(GtkWidget *vnc,
30 GValueArray *credList,
31 char **message);
32
33 int virt_viewer_auth_collect_credentials(const char *type,
34 const char *address,
35 char **username,
36 char **password);
37
38 int virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
39 unsigned int ncred,
40 void *cbdata);
41
42 #endif
0 <?xml version="1.0"?>
1 <interface>
2 <!-- interface-requires gtk+ 2.12 -->
3 <!-- interface-naming-policy toplevel-contextual -->
4 <object class="GtkDialog" id="auth">
5 <property name="border_width">5</property>
6 <property name="title" translatable="yes">Authentication required</property>
7 <property name="window_position">center-on-parent</property>
8 <property name="type_hint">dialog</property>
9 <child internal-child="vbox">
10 <object class="GtkVBox" id="dialog-vbox1">
11 <property name="visible">True</property>
12 <property name="spacing">2</property>
13 <child>
14 <object class="GtkLabel" id="message">
15 <property name="visible">True</property>
16 <property name="xalign">0</property>
17 <property name="yalign">0</property>
18 <property name="label" translatable="yes">label</property>
19 <property name="use_markup">True</property>
20 </object>
21 <packing>
22 <property name="position">1</property>
23 </packing>
24 </child>
25 <child>
26 <object class="GtkTable" id="table1">
27 <property name="visible">True</property>
28 <property name="n_rows">2</property>
29 <property name="n_columns">2</property>
30 <property name="column_spacing">6</property>
31 <property name="row_spacing">6</property>
32 <child>
33 <object class="GtkLabel" id="prompt-password">
34 <property name="visible">True</property>
35 <property name="xalign">1</property>
36 <property name="label" translatable="yes">Password:</property>
37 </object>
38 <packing>
39 <property name="top_attach">1</property>
40 <property name="bottom_attach">2</property>
41 </packing>
42 </child>
43 <child>
44 <object class="GtkLabel" id="prompt-username">
45 <property name="visible">True</property>
46 <property name="xalign">1</property>
47 <property name="label" translatable="yes">Username:</property>
48 </object>
49 </child>
50 <child>
51 <object class="GtkEntry" id="cred-username">
52 <property name="visible">True</property>
53 <property name="can_focus">True</property>
54 </object>
55 <packing>
56 <property name="left_attach">1</property>
57 <property name="right_attach">2</property>
58 </packing>
59 </child>
60 <child>
61 <object class="GtkEntry" id="cred-password">
62 <property name="visible">True</property>
63 <property name="can_focus">True</property>
64 <property name="visibility">False</property>
65 </object>
66 <packing>
67 <property name="left_attach">1</property>
68 <property name="right_attach">2</property>
69 <property name="top_attach">1</property>
70 <property name="bottom_attach">2</property>
71 </packing>
72 </child>
73 </object>
74 <packing>
75 <property name="position">2</property>
76 </packing>
77 </child>
78 <child internal-child="action_area">
79 <object class="GtkHButtonBox" id="dialog-action_area1">
80 <property name="visible">True</property>
81 <property name="layout_style">end</property>
82 <child>
83 <object class="GtkButton" id="button-cancel">
84 <property name="label">gtk-cancel</property>
85 <property name="visible">True</property>
86 <property name="can_focus">True</property>
87 <property name="receives_default">True</property>
88 <property name="use_stock">True</property>
89 </object>
90 <packing>
91 <property name="expand">False</property>
92 <property name="fill">False</property>
93 <property name="position">0</property>
94 </packing>
95 </child>
96 <child>
97 <object class="GtkButton" id="button-ok">
98 <property name="label">gtk-ok</property>
99 <property name="visible">True</property>
100 <property name="can_focus">True</property>
101 <property name="can_default">True</property>
102 <property name="has_default">True</property>
103 <property name="receives_default">True</property>
104 <property name="use_stock">True</property>
105 </object>
106 <packing>
107 <property name="expand">False</property>
108 <property name="fill">False</property>
109 <property name="position">3</property>
110 </packing>
111 </child>
112 </object>
113 <packing>
114 <property name="expand">False</property>
115 <property name="pack_type">end</property>
116 <property name="position">0</property>
117 </packing>
118 </child>
119 </object>
120 </child>
121 <action-widgets>
122 <action-widget response="-6">button-cancel</action-widget>
123 <action-widget response="-5">button-ok</action-widget>
124 </action-widgets>
125 </object>
126 </interface>
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23
24 #include <spice-audio.h>
25
26 #include <glib/gi18n.h>
27
28 #include "virt-viewer-util.h"
29 #include "virt-viewer-display-spice.h"
30 #include "virt-viewer-auth.h"
31
32 G_DEFINE_TYPE (VirtViewerDisplaySpice, virt_viewer_display_spice, VIRT_VIEWER_TYPE_DISPLAY)
33
34 struct _VirtViewerDisplaySpicePrivate {
35 SpiceChannel *channel;
36 SpiceDisplay *display;
37 };
38
39 #define VIRT_VIEWER_DISPLAY_SPICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpicePrivate))
40
41 static void virt_viewer_display_spice_send_keys(VirtViewerDisplay *display,
42 const guint *keyvals,
43 int nkeyvals);
44 static GdkPixbuf *virt_viewer_display_spice_get_pixbuf(VirtViewerDisplay *display);
45
46 static void
47 virt_viewer_display_spice_finalize(GObject *obj)
48 {
49 VirtViewerDisplaySpice *spice = VIRT_VIEWER_DISPLAY_SPICE(obj);
50
51 g_object_unref(spice->priv->display);
52 g_object_unref(spice->priv->channel);
53
54 G_OBJECT_CLASS(virt_viewer_display_spice_parent_class)->finalize(obj);
55 }
56
57 static void
58 virt_viewer_display_spice_class_init(VirtViewerDisplaySpiceClass *klass)
59 {
60 VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass);
61 GObjectClass *oclass = G_OBJECT_CLASS(klass);
62
63 oclass->finalize = virt_viewer_display_spice_finalize;
64
65 dclass->send_keys = virt_viewer_display_spice_send_keys;
66 dclass->get_pixbuf = virt_viewer_display_spice_get_pixbuf;
67
68 g_type_class_add_private(oclass, sizeof(VirtViewerDisplaySpicePrivate));
69 }
70
71 static void
72 virt_viewer_display_spice_init(VirtViewerDisplaySpice *self G_GNUC_UNUSED)
73 {
74 self->priv = VIRT_VIEWER_DISPLAY_SPICE_GET_PRIVATE(self);
75 }
76
77 static void
78 virt_viewer_display_spice_send_keys(VirtViewerDisplay *display,
79 const guint *keyvals,
80 int nkeyvals)
81 {
82 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
83
84 g_return_if_fail(self != NULL);
85 g_return_if_fail(self->priv->display != NULL);
86
87 spice_display_send_keys(self->priv->display, keyvals, nkeyvals, SPICE_DISPLAY_KEY_EVENT_CLICK);
88 }
89
90 static GdkPixbuf *
91 virt_viewer_display_spice_get_pixbuf(VirtViewerDisplay *display)
92 {
93 VirtViewerDisplaySpice *self = VIRT_VIEWER_DISPLAY_SPICE(display);
94
95 g_return_val_if_fail(self != NULL, NULL);
96 g_return_val_if_fail(self->priv->display != NULL, NULL);
97
98 return spice_display_get_pixbuf(self->priv->display);
99 }
100
101 static void
102 virt_viewer_display_spice_primary_create(SpiceChannel *channel G_GNUC_UNUSED,
103 gint format G_GNUC_UNUSED,
104 gint width,
105 gint height,
106 gint stride G_GNUC_UNUSED,
107 gint shmid G_GNUC_UNUSED,
108 gpointer imgdata G_GNUC_UNUSED,
109 VirtViewerDisplay *display)
110 {
111 DEBUG_LOG("desktop resize %dx%d", width, height);
112
113 virt_viewer_display_set_desktop_size(display, width, height);
114 g_signal_emit_by_name(display, "display-desktop-resize");
115 }
116
117
118 GtkWidget *
119 virt_viewer_display_spice_new(SpiceChannel *channel,
120 SpiceDisplay *display)
121 {
122 VirtViewerDisplaySpice *self;
123
124 self = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_SPICE, NULL);
125
126 self->priv->channel = channel;
127 self->priv->display = display;
128
129 g_object_ref(channel);
130 g_object_ref(display);
131
132 g_signal_connect(channel, "display-primary-create",
133 G_CALLBACK(virt_viewer_display_spice_primary_create), self);
134
135 gtk_container_add(GTK_CONTAINER(self), GTK_WIDGET(self->priv->display));
136 gtk_widget_show(GTK_WIDGET(self->priv->display));
137 g_object_set(self->priv->display,
138 "grab-keyboard", TRUE,
139 "grab-mouse", TRUE,
140 "resize-guest", FALSE,
141 "scaling", TRUE,
142 "auto-clipboard", TRUE,
143 NULL);
144
145 return GTK_WIDGET(self);
146 }
147
148 /*
149 * Local variables:
150 * c-indent-level: 8
151 * c-basic-offset: 8
152 * tab-width: 8
153 * indent-tabs-mode: t
154 * End:
155 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #ifndef _VIRT_VIEWER_DISPLAY_SPICE_H
24 #define _VIRT_VIEWER_DISPLAY_SPICE_H
25
26 #include <glib-object.h>
27 #include <spice-widget.h>
28 #include <spice-audio.h>
29
30 #include "virt-viewer-display.h"
31
32 G_BEGIN_DECLS
33
34 #define VIRT_VIEWER_TYPE_DISPLAY_SPICE virt_viewer_display_spice_get_type()
35
36 #define VIRT_VIEWER_DISPLAY_SPICE(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpice))
38
39 #define VIRT_VIEWER_DISPLAY_SPICE_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass))
41
42 #define VIRT_IS_VIEWER_DISPLAY_SPICE(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE))
44
45 #define VIRT_IS_VIEWER_DISPLAY_SPICE_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_SPICE))
47
48 #define VIRT_VIEWER_DISPLAY_SPICE_GET_CLASS(obj) \
49 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpiceClass))
50
51 typedef struct _VirtViewerDisplaySpice VirtViewerDisplaySpice;
52 typedef struct _VirtViewerDisplaySpiceClass VirtViewerDisplaySpiceClass;
53 typedef struct _VirtViewerDisplaySpicePrivate VirtViewerDisplaySpicePrivate;
54
55 struct _VirtViewerDisplaySpice {
56 VirtViewerDisplay parent;
57
58 VirtViewerDisplaySpicePrivate *priv;
59 };
60
61 struct _VirtViewerDisplaySpiceClass {
62 VirtViewerDisplayClass parent_class;
63 };
64
65 GType virt_viewer_display_spice_get_type(void);
66
67 GtkWidget* virt_viewer_display_spice_new(SpiceChannel *channel,
68 SpiceDisplay *display);
69
70 G_END_DECLS
71
72 #endif /* _VIRT_VIEWER_DISPLAY_SPICE_H */
73
74 /*
75 * Local variables:
76 * c-indent-level: 8
77 * c-basic-offset: 8
78 * tab-width: 8
79 * End:
80 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23
24 #include "virt-viewer-auth.h"
25 #include "virt-viewer-display-vnc.h"
26
27 #include <glib/gi18n.h>
28
29 G_DEFINE_TYPE(VirtViewerDisplayVnc, virt_viewer_display_vnc, VIRT_VIEWER_TYPE_DISPLAY)
30
31 struct _VirtViewerDisplayVncPrivate {
32 VncDisplay *vnc;
33 };
34
35 #define VIRT_VIEWER_DISPLAY_VNC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncPrivate))
36
37 static void virt_viewer_display_vnc_send_keys(VirtViewerDisplay* display, const guint *keyvals, int nkeyvals);
38 static GdkPixbuf *virt_viewer_display_vnc_get_pixbuf(VirtViewerDisplay* display);
39
40 static void
41 virt_viewer_display_vnc_finalize(GObject *obj)
42 {
43 VirtViewerDisplayVnc *vnc = VIRT_VIEWER_DISPLAY_VNC(obj);
44
45 g_object_unref(vnc->priv->vnc);
46
47 G_OBJECT_CLASS(virt_viewer_display_vnc_parent_class)->finalize(obj);
48 }
49
50
51 static void
52 virt_viewer_display_vnc_class_init(VirtViewerDisplayVncClass *klass)
53 {
54 VirtViewerDisplayClass *dclass = VIRT_VIEWER_DISPLAY_CLASS(klass);
55 GObjectClass *oclass = G_OBJECT_CLASS(klass);
56
57 oclass->finalize = virt_viewer_display_vnc_finalize;
58
59 dclass->send_keys = virt_viewer_display_vnc_send_keys;
60 dclass->get_pixbuf = virt_viewer_display_vnc_get_pixbuf;
61
62 g_type_class_add_private(oclass, sizeof(VirtViewerDisplayVncPrivate));
63 }
64
65 static void
66 virt_viewer_display_vnc_init(VirtViewerDisplayVnc *self G_GNUC_UNUSED)
67 {
68 self->priv = VIRT_VIEWER_DISPLAY_VNC_GET_PRIVATE(self);
69 }
70
71
72 static void
73 virt_viewer_display_vnc_mouse_grab(VncDisplay *vnc G_GNUC_UNUSED,
74 VirtViewerDisplay *display)
75 {
76 g_signal_emit_by_name(display, "display-pointer-grab");
77 }
78
79
80 static void
81 virt_viewer_display_vnc_mouse_ungrab(VncDisplay *vnc G_GNUC_UNUSED,
82 VirtViewerDisplay *display)
83 {
84 g_signal_emit_by_name(display, "display-pointer-ungrab");
85 }
86
87 static void
88 virt_viewer_display_vnc_key_grab(VncDisplay *vnc G_GNUC_UNUSED,
89 VirtViewerDisplay *display)
90 {
91 g_signal_emit_by_name(display, "display-keyboard-grab");
92 }
93
94 static void
95 virt_viewer_display_vnc_key_ungrab(VncDisplay *vnc G_GNUC_UNUSED,
96 VirtViewerDisplay *display)
97 {
98 g_signal_emit_by_name(display, "display-keyboard-ungrab");
99 }
100
101 static void
102 virt_viewer_display_vnc_send_keys(VirtViewerDisplay* display,
103 const guint *keyvals,
104 int nkeyvals)
105 {
106 VirtViewerDisplayVnc *self = VIRT_VIEWER_DISPLAY_VNC(display);
107
108 g_return_if_fail(self != NULL);
109 g_return_if_fail(keyvals != NULL);
110 g_return_if_fail(self->priv->vnc != NULL);
111
112 vnc_display_send_keys(self->priv->vnc, keyvals, nkeyvals);
113 }
114
115
116 static GdkPixbuf *
117 virt_viewer_display_vnc_get_pixbuf(VirtViewerDisplay* display)
118 {
119 VirtViewerDisplayVnc *self = VIRT_VIEWER_DISPLAY_VNC(display);
120
121 g_return_val_if_fail(self != NULL, NULL);
122 g_return_val_if_fail(self->priv->vnc != NULL, NULL);
123
124 return vnc_display_get_pixbuf(self->priv->vnc);
125 }
126
127
128 /*
129 * Called when desktop size changes.
130 *
131 * It either tries to resize the main window, or it triggers
132 * recalculation of the display within existing window size
133 */
134 static void
135 virt_viewer_display_vnc_resize_desktop(VncDisplay *vnc G_GNUC_UNUSED,
136 int width, int height,
137 VirtViewerDisplay *display)
138 {
139 DEBUG_LOG("desktop resize %dx%d", width, height);
140
141 virt_viewer_display_set_desktop_size(display, width, height);
142 g_signal_emit_by_name(display, "display-desktop-resize");
143 }
144
145
146 GtkWidget *
147 virt_viewer_display_vnc_new(VncDisplay *vnc)
148 {
149 VirtViewerDisplayVnc *display;
150
151 display = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_VNC, NULL);
152
153 g_object_ref(vnc);
154 g_object_ref(vnc); /* Because gtk_container_add steals the first ref */
155 display->priv->vnc = vnc;
156
157 gtk_container_add(GTK_CONTAINER(display), GTK_WIDGET(display->priv->vnc));
158 vnc_display_set_keyboard_grab(display->priv->vnc, TRUE);
159 vnc_display_set_pointer_grab(display->priv->vnc, TRUE);
160
161 /*
162 * In auto-resize mode we have things setup so that we always
163 * automatically resize the top level window to be exactly the
164 * same size as the VNC desktop, except when it won't fit on
165 * the local screen, at which point we let it scale down.
166 * The upshot is, we always want scaling enabled.
167 * We disable force_size because we want to allow user to
168 * manually size the widget smaller too
169 */
170 vnc_display_set_force_size(display->priv->vnc, FALSE);
171 vnc_display_set_scaling(display->priv->vnc, TRUE);
172
173 /* When VNC desktop resizes, we have to resize the containing widget */
174 g_signal_connect(display->priv->vnc, "vnc-desktop-resize",
175 G_CALLBACK(virt_viewer_display_vnc_resize_desktop), display);
176
177 g_signal_connect(display->priv->vnc, "vnc-pointer-grab",
178 G_CALLBACK(virt_viewer_display_vnc_mouse_grab), display);
179 g_signal_connect(display->priv->vnc, "vnc-pointer-ungrab",
180 G_CALLBACK(virt_viewer_display_vnc_mouse_ungrab), display);
181 g_signal_connect(display->priv->vnc, "vnc-keyboard-grab",
182 G_CALLBACK(virt_viewer_display_vnc_key_grab), display);
183 g_signal_connect(display->priv->vnc, "vnc-keyboard-ungrab",
184 G_CALLBACK(virt_viewer_display_vnc_key_ungrab), display);
185
186 return GTK_WIDGET(display);
187 }
188
189
190
191
192 /*
193 * Local variables:
194 * c-indent-level: 8
195 * c-basic-offset: 8
196 * tab-width: 8
197 * End:
198 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #ifndef _VIRT_VIEWER_DISPLAY_VNC_H
24 #define _VIRT_VIEWER_DISPLAY_VNC_H
25
26 #include <glib-object.h>
27 #include <vncdisplay.h>
28
29 #include "virt-viewer-display.h"
30
31 G_BEGIN_DECLS
32
33 #define VIRT_VIEWER_TYPE_DISPLAY_VNC virt_viewer_display_vnc_get_type()
34
35 #define VIRT_VIEWER_DISPLAY_VNC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVnc))
37
38 #define VIRT_VIEWER_DISPLAY_VNC_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncClass))
40
41 #define VIRT_IS_VIEWER_DISPLAY_VNC(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC))
43
44 #define VIRT_IS_VIEWER_DISPLAY_VNC_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY_VNC))
46
47 #define VIRT_VIEWER_DISPLAY_VNC_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY_VNC, VirtViewerDisplayVncClass))
49
50 typedef struct _VirtViewerDisplayVnc VirtViewerDisplayVnc;
51 typedef struct _VirtViewerDisplayVncClass VirtViewerDisplayVncClass;
52 typedef struct _VirtViewerDisplayVncPrivate VirtViewerDisplayVncPrivate;
53
54 struct _VirtViewerDisplayVnc {
55 VirtViewerDisplay parent;
56
57 VirtViewerDisplayVncPrivate *priv;
58 };
59
60 struct _VirtViewerDisplayVncClass {
61 VirtViewerDisplayClass parent_class;
62 };
63
64 GType virt_viewer_display_vnc_get_type(void);
65
66 GtkWidget* virt_viewer_display_vnc_new(VncDisplay *display);
67
68 G_END_DECLS
69
70 #endif /* _VIRT_VIEWER_DISPLAY_VNC_H */
71
72 /*
73 * Local variables:
74 * c-indent-level: 8
75 * c-basic-offset: 8
76 * tab-width: 8
77 * End:
78 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23
24 #include <config.h>
25
26 #include <locale.h>
27
28 #include "virt-viewer-display.h"
29 #include "virt-viewer-util.h"
30
31 #define VIRT_VIEWER_DISPLAY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayPrivate))
32
33 struct _VirtViewerDisplayPrivate
34 {
35 gboolean dirty;
36 guint desktopWidth;
37 guint desktopHeight;
38 guint zoom_level;
39 gboolean zoom;
40 };
41
42 static void virt_viewer_display_size_request(GtkWidget *widget,
43 GtkRequisition *requisition);
44 #if GTK_CHECK_VERSION(3, 0, 0)
45 static void virt_viewer_display_get_preferred_width(GtkWidget *widget,
46 int *minwidth,
47 int *defwidth);
48 static void virt_viewer_display_get_preferred_height(GtkWidget *widget,
49 int *minheight,
50 int *defheight);
51 #endif
52 static void virt_viewer_display_size_allocate(GtkWidget *widget,
53 GtkAllocation *allocation);
54 static void virt_viewer_display_set_property(GObject *object,
55 guint prop_id,
56 const GValue *value,
57 GParamSpec *pspec);
58 static void virt_viewer_display_get_property(GObject *object,
59 guint prop_id,
60 GValue *value,
61 GParamSpec *pspec);
62
63 G_DEFINE_ABSTRACT_TYPE(VirtViewerDisplay, virt_viewer_display, GTK_TYPE_BIN)
64
65 enum {
66 PROP_0,
67
68 PROP_DESKTOP_WIDTH,
69 PROP_DESKTOP_HEIGHT,
70 PROP_ZOOM,
71 PROP_ZOOM_LEVEL,
72 };
73
74 static void
75 virt_viewer_display_class_init(VirtViewerDisplayClass *class)
76 {
77 GObjectClass *object_class = G_OBJECT_CLASS(class);
78 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(class);
79
80 object_class->set_property = virt_viewer_display_set_property;
81 object_class->get_property = virt_viewer_display_get_property;
82
83 #if GTK_CHECK_VERSION(3, 0, 0)
84 widget_class->get_preferred_width = virt_viewer_display_get_preferred_width;
85 widget_class->get_preferred_height = virt_viewer_display_get_preferred_height;
86 #else
87 widget_class->size_request = virt_viewer_display_size_request;
88 #endif
89 widget_class->size_allocate = virt_viewer_display_size_allocate;
90
91 g_object_class_install_property(object_class,
92 PROP_DESKTOP_WIDTH,
93 g_param_spec_int("desktop-width",
94 "Width",
95 "Desktop width",
96 100,
97 G_MAXINT32,
98 100,
99 G_PARAM_READWRITE));
100 g_object_class_install_property(object_class,
101 PROP_DESKTOP_HEIGHT,
102 g_param_spec_int("desktop-height",
103 "Height",
104 "Desktop height",
105 100,
106 G_MAXINT32,
107 100,
108 G_PARAM_READWRITE));
109 g_object_class_install_property(object_class,
110 PROP_ZOOM,
111 g_param_spec_boolean("zoom",
112 "Zoom",
113 "Zoom",
114 TRUE,
115 G_PARAM_READWRITE));
116 g_object_class_install_property(object_class,
117 PROP_ZOOM_LEVEL,
118 g_param_spec_int("zoom-level",
119 "Zoom",
120 "Zoom level",
121 10,
122 400,
123 100,
124 G_PARAM_READWRITE));
125
126
127 g_signal_new("display-pointer-grab",
128 G_OBJECT_CLASS_TYPE(object_class),
129 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
130 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_grab),
131 NULL,
132 NULL,
133 g_cclosure_marshal_VOID__VOID,
134 G_TYPE_NONE,
135 0);
136
137 g_signal_new("display-pointer-ungrab",
138 G_OBJECT_CLASS_TYPE(object_class),
139 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
140 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_pointer_ungrab),
141 NULL,
142 NULL,
143 g_cclosure_marshal_VOID__VOID,
144 G_TYPE_NONE,
145 0);
146
147 g_signal_new("display-keyboard-grab",
148 G_OBJECT_CLASS_TYPE(object_class),
149 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
150 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_grab),
151 NULL,
152 NULL,
153 g_cclosure_marshal_VOID__VOID,
154 G_TYPE_NONE,
155 0);
156
157 g_signal_new("display-keyboard-ungrab",
158 G_OBJECT_CLASS_TYPE(object_class),
159 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
160 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_keyboard_ungrab),
161 NULL,
162 NULL,
163 g_cclosure_marshal_VOID__VOID,
164 G_TYPE_NONE,
165 0);
166
167 g_signal_new("display-desktop-resize",
168 G_OBJECT_CLASS_TYPE(object_class),
169 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
170 G_STRUCT_OFFSET(VirtViewerDisplayClass, display_desktop_resize),
171 NULL,
172 NULL,
173 g_cclosure_marshal_VOID__VOID,
174 G_TYPE_NONE,
175 0);
176
177 g_type_class_add_private(object_class, sizeof(VirtViewerDisplayPrivate));
178 }
179
180 static void
181 virt_viewer_display_init(VirtViewerDisplay *display)
182 {
183 gtk_widget_set_has_window(GTK_WIDGET(display), FALSE);
184 gtk_widget_set_redraw_on_allocate(GTK_WIDGET(display), FALSE);
185
186 display->priv = VIRT_VIEWER_DISPLAY_GET_PRIVATE(display);
187
188 display->priv->desktopWidth = 100;
189 display->priv->desktopHeight = 100;
190 display->priv->zoom_level = 100;
191 display->priv->zoom = TRUE;
192 }
193
194 GtkWidget*
195 virt_viewer_display_new(void)
196 {
197 return g_object_new(VIRT_VIEWER_TYPE_DISPLAY, NULL);
198 }
199
200 static void
201 virt_viewer_display_set_property(GObject *object,
202 guint prop_id,
203 const GValue *value,
204 GParamSpec *pspec)
205 {
206 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(object);
207 VirtViewerDisplayPrivate *priv = display->priv;
208
209 switch (prop_id) {
210 case PROP_DESKTOP_WIDTH:
211 virt_viewer_display_set_desktop_size(display,
212 g_value_get_int(value),
213 priv->desktopHeight);
214 break;
215 case PROP_DESKTOP_HEIGHT:
216 virt_viewer_display_set_desktop_size(display,
217 priv->desktopWidth,
218 g_value_get_int(value));
219 break;
220
221 default:
222 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
223 break;
224 }
225 }
226
227 static void
228 virt_viewer_display_get_property(GObject *object,
229 guint prop_id,
230 GValue *value,
231 GParamSpec *pspec)
232 {
233 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(object);
234 VirtViewerDisplayPrivate *priv = display->priv;
235
236 switch (prop_id) {
237 case PROP_DESKTOP_WIDTH:
238 g_value_set_int(value, priv->desktopWidth);
239 break;
240 case PROP_DESKTOP_HEIGHT:
241 g_value_set_int(value, priv->desktopHeight);
242 break;
243
244 default:
245 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
246 break;
247 }
248 }
249
250
251 static gboolean
252 virt_viewer_display_idle(gpointer opaque)
253 {
254 VirtViewerDisplay *display = opaque;
255 VirtViewerDisplayPrivate *priv = display->priv;
256 if (!priv->dirty)
257 gtk_widget_queue_resize_no_redraw(GTK_WIDGET(display));
258 return FALSE;
259 }
260
261
262 static void
263 virt_viewer_display_size_request(GtkWidget *widget,
264 GtkRequisition *requisition)
265 {
266 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(widget);
267 VirtViewerDisplayPrivate *priv = display->priv;
268 int border_width = gtk_container_get_border_width(GTK_CONTAINER(widget));
269
270 requisition->width = border_width * 2;
271 requisition->height = border_width * 2;
272
273 if (priv->dirty) {
274 if (priv->zoom)
275 requisition->width += priv->desktopWidth * priv->zoom_level / 100;
276 else
277 requisition->width += priv->desktopWidth;
278 } else {
279 requisition->width += 50;
280 }
281 if (priv->dirty) {
282 if (priv->zoom)
283 requisition->height += priv->desktopHeight * priv->zoom_level / 100;
284 else
285 requisition->height += priv->desktopHeight;
286 } else {
287 requisition->height += 50;
288 }
289
290 DEBUG_LOG("Display size request %dx%d (desktop %dx%d)",
291 requisition->width, requisition->height,
292 priv->desktopWidth, priv->desktopHeight);
293 }
294
295
296 #if GTK_CHECK_VERSION(3, 0, 0)
297 static void virt_viewer_display_get_preferred_width(GtkWidget *widget,
298 int *minwidth,
299 int *defwidth)
300 {
301 GtkRequisition req;
302
303 virt_viewer_display_size_request(widget, &req);
304
305 *minwidth = *defwidth = req.width;
306 }
307
308
309 static void virt_viewer_display_get_preferred_height(GtkWidget *widget,
310 int *minheight,
311 int *defheight)
312 {
313 GtkRequisition req;
314
315 virt_viewer_display_size_request(widget, &req);
316
317 *minheight = *defheight = req.height;
318 }
319 #endif
320
321
322 static void
323 virt_viewer_display_size_allocate(GtkWidget *widget,
324 GtkAllocation *allocation)
325 {
326 GtkBin *bin = GTK_BIN(widget);
327 VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(widget);
328 VirtViewerDisplayPrivate *priv = display->priv;
329 GtkAllocation child_allocation;
330 gint width, height;
331 gint border_width;
332 double desktopAspect;
333 double actualAspect;
334 GtkWidget *child = gtk_bin_get_child(bin);
335
336 DEBUG_LOG("Allocated %dx%d", allocation->width, allocation->height);
337 gtk_widget_set_allocation(widget, allocation);
338
339 desktopAspect = (double)priv->desktopWidth / (double)priv->desktopHeight;
340
341 if (child && gtk_widget_get_visible(child)) {
342 border_width = gtk_container_get_border_width(GTK_CONTAINER(display));
343
344 width = MAX(1, allocation->width - 2 * border_width);
345 height = MAX(1, allocation->height - 2 * border_width);
346 actualAspect = (double)width / (double)height;
347
348 if (actualAspect > desktopAspect) {
349 child_allocation.width = height * desktopAspect;
350 child_allocation.height = height;
351 } else {
352 child_allocation.width = width;
353 child_allocation.height = width / desktopAspect;
354 }
355
356 child_allocation.x = 0.5 * (width - child_allocation.width) + allocation->x + border_width;
357 child_allocation.y = 0.5 * (height - child_allocation.height) + allocation->y + border_width;
358
359 DEBUG_LOG("Child allocate %dx%d", child_allocation.width, child_allocation.height);
360 gtk_widget_size_allocate(child, &child_allocation);
361 }
362
363
364 /* This unsets the size request, so that the user can
365 * manually resize the window smaller again
366 */
367 if (priv->dirty) {
368 g_idle_add(virt_viewer_display_idle, widget);
369 priv->dirty = FALSE;
370 }
371 }
372
373
374 void virt_viewer_display_set_desktop_size(VirtViewerDisplay *display,
375 guint width,
376 guint height)
377 {
378 VirtViewerDisplayPrivate *priv = display->priv;
379
380 priv->desktopWidth = width;
381 priv->desktopHeight = height;
382 priv->dirty = TRUE;
383
384 gtk_widget_queue_resize(GTK_WIDGET(display));
385 }
386
387
388 void virt_viewer_display_get_desktop_size(VirtViewerDisplay *display,
389 guint *width,
390 guint *height)
391 {
392 VirtViewerDisplayPrivate *priv = display->priv;
393
394 *width = priv->desktopWidth;
395 *height = priv->desktopHeight;
396 }
397
398
399 void virt_viewer_display_set_zoom_level(VirtViewerDisplay *display,
400 guint zoom)
401 {
402 VirtViewerDisplayPrivate *priv = display->priv;
403 GtkWidget *child = gtk_bin_get_child(GTK_BIN(display));
404
405 if (zoom < 10)
406 zoom = 10;
407 if (zoom > 400)
408 zoom = 400;
409 priv->zoom_level = zoom;
410
411 if (child && gtk_widget_get_visible(child)) {
412 priv->dirty = TRUE;
413 gtk_widget_queue_resize(GTK_WIDGET(display));
414 }
415 }
416
417
418 void virt_viewer_display_set_zoom(VirtViewerDisplay *display,
419 gboolean zoom)
420 {
421 VirtViewerDisplayPrivate *priv = display->priv;
422 GtkWidget *child = gtk_bin_get_child(GTK_BIN(display));
423
424 priv->zoom = zoom;
425 if (child && gtk_widget_get_visible(child)) {
426 priv->dirty = TRUE;
427 gtk_widget_queue_resize(GTK_WIDGET(display));
428 }
429 }
430
431 void virt_viewer_display_send_keys(VirtViewerDisplay *display,
432 const guint *keyvals, int nkeyvals)
433 {
434 g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(display));
435
436 VIRT_VIEWER_DISPLAY_GET_CLASS(display)->send_keys(display, keyvals, nkeyvals);
437 }
438
439 GdkPixbuf* virt_viewer_display_get_pixbuf(VirtViewerDisplay *display)
440 {
441 g_return_val_if_fail(VIRT_VIEWER_IS_DISPLAY(display), NULL);
442
443 return VIRT_VIEWER_DISPLAY_GET_CLASS(display)->get_pixbuf(display);
444 }
445
446 /*
447 * Local variables:
448 * c-indent-level: 8
449 * c-basic-offset: 8
450 * tab-width: 8
451 * End:
452 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #ifndef _VIRT_VIEWER_DISPLAY_H
24 #define _VIRT_VIEWER_DISPLAY_H
25
26 #include <gtk/gtk.h>
27
28 G_BEGIN_DECLS
29
30 #define VIRT_VIEWER_TYPE_DISPLAY virt_viewer_display_get_type()
31
32 #define VIRT_VIEWER_DISPLAY(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplay))
34
35 #define VIRT_VIEWER_DISPLAY_CLASS(klass) \
36 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass))
37
38 #define VIRT_VIEWER_IS_DISPLAY(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_DISPLAY))
40
41 #define VIRT_VIEWER_IS_DISPLAY_CLASS(klass) \
42 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_DISPLAY))
43
44 #define VIRT_VIEWER_DISPLAY_GET_CLASS(obj) \
45 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_DISPLAY, VirtViewerDisplayClass))
46
47 typedef struct _VirtViewerDisplay VirtViewerDisplay;
48 typedef struct _VirtViewerDisplayClass VirtViewerDisplayClass;
49 typedef struct _VirtViewerDisplayPrivate VirtViewerDisplayPrivate;
50
51 typedef struct _VirtViewerDisplayChannel VirtViewerDisplayChannel;
52
53
54 /* perhaps this become an interface, and be pushed in gtkvnc and spice? */
55 struct _VirtViewerDisplay {
56 GtkBin parent;
57
58 VirtViewerDisplayPrivate *priv;
59 };
60
61 struct _VirtViewerDisplayClass {
62 GtkBinClass parent_class;
63
64 /* virtual methods */
65 void (*send_keys)(VirtViewerDisplay* display,
66 const guint *keyvals, int nkeyvals);
67 GdkPixbuf *(*get_pixbuf)(VirtViewerDisplay* display);
68
69 /* signals */
70 void (*display_pointer_grab)(VirtViewerDisplay *display);
71 void (*display_pointer_ungrab)(VirtViewerDisplay *display);
72 void (*display_keyboard_grab)(VirtViewerDisplay *display);
73 void (*display_keyboard_ungrab)(VirtViewerDisplay *display);
74
75 void (*display_desktop_resize)(VirtViewerDisplay *display);
76 };
77
78 GType virt_viewer_display_get_type(void);
79
80 GtkWidget *virt_viewer_display_new(void);
81
82 void virt_viewer_display_set_desktop_size(VirtViewerDisplay *display,
83 guint width,
84 guint height);
85
86 void virt_viewer_display_get_desktop_size(VirtViewerDisplay *display,
87 guint *width,
88 guint *height);
89
90 void virt_viewer_display_set_zoom_level(VirtViewerDisplay *display,
91 guint zoom);
92 void virt_viewer_display_set_zoom(VirtViewerDisplay *display,
93 gboolean zoom);
94
95 void virt_viewer_display_send_keys(VirtViewerDisplay* display,
96 const guint *keyvals, int nkeyvals);
97 GdkPixbuf* virt_viewer_display_get_pixbuf(VirtViewerDisplay* display);
98
99 G_END_DECLS
100
101 #endif /* _VIRT_VIEWER_DISPLAY_H */
102 /*
103 * Local variables:
104 * c-indent-level: 8
105 * c-basic-offset: 8
106 * tab-width: 8
107 * End:
108 */
0 /*
1 * events.c: event loop integration
2 *
3 * Copyright (C) 2008-2009 Daniel P. Berrange
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22
23 #include <stdio.h>
24 #include <string.h>
25 #include <stdlib.h>
26 #include <glib.h>
27 #include <libvirt/libvirt.h>
28
29 #include "virt-viewer-events.h"
30
31 struct virt_viewer_events_handle
32 {
33 int watch;
34 int fd;
35 int events;
36 int enabled;
37 GIOChannel *channel;
38 guint source;
39 virEventHandleCallback cb;
40 void *opaque;
41 virFreeCallback ff;
42 };
43
44 static int nextwatch = 1;
45 static unsigned int nhandles = 0;
46 static struct virt_viewer_events_handle **handles = NULL;
47
48 static gboolean
49 virt_viewer_events_dispatch_handle(GIOChannel *source G_GNUC_UNUSED,
50 GIOCondition condition,
51 gpointer opaque)
52 {
53 struct virt_viewer_events_handle *data = opaque;
54 int events = 0;
55
56 if (condition & G_IO_IN)
57 events |= VIR_EVENT_HANDLE_READABLE;
58 if (condition & G_IO_OUT)
59 events |= VIR_EVENT_HANDLE_WRITABLE;
60 if (condition & G_IO_HUP)
61 events |= VIR_EVENT_HANDLE_HANGUP;
62 if (condition & G_IO_ERR)
63 events |= VIR_EVENT_HANDLE_ERROR;
64
65 DEBUG_LOG("Dispatch handler %d %d %p", data->fd, events, data->opaque);
66
67 (data->cb)(data->watch, data->fd, events, data->opaque);
68
69 return TRUE;
70 }
71
72
73 static
74 int virt_viewer_events_add_handle(int fd,
75 int events,
76 virEventHandleCallback cb,
77 void *opaque,
78 virFreeCallback ff)
79 {
80 struct virt_viewer_events_handle *data;
81 GIOCondition cond = 0;
82
83 handles = g_realloc(handles, sizeof(*handles)*(nhandles+1));
84 data = g_malloc(sizeof(*data));
85 memset(data, 0, sizeof(*data));
86
87 if (events & VIR_EVENT_HANDLE_READABLE)
88 cond |= G_IO_IN;
89 if (events & VIR_EVENT_HANDLE_WRITABLE)
90 cond |= G_IO_OUT;
91
92 data->watch = nextwatch++;
93 data->fd = fd;
94 data->events = events;
95 data->cb = cb;
96 data->opaque = opaque;
97 data->channel = g_io_channel_unix_new(fd);
98 data->ff = ff;
99
100 DEBUG_LOG("Add handle %d %d %p", data->fd, events, data->opaque);
101
102 data->source = g_io_add_watch(data->channel,
103 cond,
104 virt_viewer_events_dispatch_handle,
105 data);
106
107 handles[nhandles++] = data;
108
109 return data->watch;
110 }
111
112 static struct virt_viewer_events_handle *
113 virt_viewer_events_find_handle(int watch)
114 {
115 unsigned int i;
116 for (i = 0 ; i < nhandles ; i++)
117 if (handles[i]->watch == watch)
118 return handles[i];
119
120 return NULL;
121 }
122
123 static void
124 virt_viewer_events_update_handle(int watch,
125 int events)
126 {
127 struct virt_viewer_events_handle *data = virt_viewer_events_find_handle(watch);
128
129 if (!data) {
130 DEBUG_LOG("Update for missing handle watch %d", watch);
131 return;
132 }
133
134 if (events) {
135 GIOCondition cond = 0;
136 if (events == data->events)
137 return;
138
139 if (data->source)
140 g_source_remove(data->source);
141
142 cond |= G_IO_HUP;
143 if (events & VIR_EVENT_HANDLE_READABLE)
144 cond |= G_IO_IN;
145 if (events & VIR_EVENT_HANDLE_WRITABLE)
146 cond |= G_IO_OUT;
147 data->source = g_io_add_watch(data->channel,
148 cond,
149 virt_viewer_events_dispatch_handle,
150 data);
151 data->events = events;
152 } else {
153 if (!data->source)
154 return;
155
156 g_source_remove(data->source);
157 data->source = 0;
158 data->events = 0;
159 }
160 }
161
162 static int
163 virt_viewer_events_remove_handle(int watch)
164 {
165 struct virt_viewer_events_handle *data = virt_viewer_events_find_handle(watch);
166
167 if (!data) {
168 DEBUG_LOG("Remove of missing watch %d", watch);
169 return -1;
170 }
171
172 DEBUG_LOG("Remove handle %d %d", watch, data->fd);
173
174 g_source_remove(data->source);
175 data->source = 0;
176 data->events = 0;
177 if (data->ff)
178 (data->ff)(data->opaque);
179 free(data);
180
181 return 0;
182 }
183
184 struct virt_viewer_events_timeout
185 {
186 int timer;
187 int interval;
188 guint source;
189 virEventTimeoutCallback cb;
190 void *opaque;
191 virFreeCallback ff;
192 };
193
194
195 static int nexttimer = 1;
196 static unsigned int ntimeouts = 0;
197 static struct virt_viewer_events_timeout **timeouts = NULL;
198
199 static gboolean
200 virt_viewer_events_dispatch_timeout(void *opaque)
201 {
202 struct virt_viewer_events_timeout *data = opaque;
203 DEBUG_LOG("Dispatch timeout %p %p %d %p", data, data->cb, data->timer, data->opaque);
204 (data->cb)(data->timer, data->opaque);
205
206 return TRUE;
207 }
208
209 static int
210 virt_viewer_events_add_timeout(int interval,
211 virEventTimeoutCallback cb,
212 void *opaque,
213 virFreeCallback ff)
214 {
215 struct virt_viewer_events_timeout *data;
216
217 timeouts = g_realloc(timeouts, sizeof(*timeouts)*(ntimeouts+1));
218 data = g_malloc(sizeof(*data));
219 memset(data, 0, sizeof(*data));
220
221 data->timer = nexttimer++;
222 data->interval = interval;
223 data->cb = cb;
224 data->opaque = opaque;
225 data->ff = ff;
226 if (interval >= 0)
227 data->source = g_timeout_add(interval,
228 virt_viewer_events_dispatch_timeout,
229 data);
230
231 timeouts[ntimeouts++] = data;
232
233 DEBUG_LOG("Add timeout %p %d %p %p %d", data, interval, cb, opaque, data->timer);
234
235 return data->timer;
236 }
237
238
239 static struct virt_viewer_events_timeout *
240 virt_viewer_events_find_timeout(int timer)
241 {
242 unsigned int i;
243 for (i = 0 ; i < ntimeouts ; i++)
244 if (timeouts[i]->timer == timer)
245 return timeouts[i];
246
247 return NULL;
248 }
249
250
251 static void
252 virt_viewer_events_update_timeout(int timer,
253 int interval)
254 {
255 struct virt_viewer_events_timeout *data = virt_viewer_events_find_timeout(timer);
256
257 if (!data) {
258 DEBUG_LOG("Update of missing timer %d", timer);
259 return;
260 }
261
262 DEBUG_LOG("Update timeout %p %d %d", data, timer, interval);
263
264 if (interval >= 0) {
265 if (data->source)
266 return;
267
268 data->interval = interval;
269 data->source = g_timeout_add(data->interval,
270 virt_viewer_events_dispatch_timeout,
271 data);
272 } else {
273 if (!data->source)
274 return;
275
276 g_source_remove(data->source);
277 data->source = 0;
278 }
279 }
280
281 static int
282 virt_viewer_events_remove_timeout(int timer)
283 {
284 struct virt_viewer_events_timeout *data = virt_viewer_events_find_timeout(timer);
285
286 if (!data) {
287 DEBUG_LOG("Remove of missing timer %d", timer);
288 return -1;
289 }
290
291 DEBUG_LOG("Remove timeout %p %d", data, timer);
292
293 if (!data->source)
294 return -1;
295
296 g_source_remove(data->source);
297 data->source = 0;
298
299 if (data->ff)
300 (data->ff)(data->opaque);
301
302 free(data);
303
304 return 0;
305 }
306
307
308 void virt_viewer_events_register(void) {
309 virEventRegisterImpl(virt_viewer_events_add_handle,
310 virt_viewer_events_update_handle,
311 virt_viewer_events_remove_handle,
312 virt_viewer_events_add_timeout,
313 virt_viewer_events_update_timeout,
314 virt_viewer_events_remove_timeout);
315 }
316
0 /*
1 * events.h: event loop integration
2 *
3 * Copyright (C) 2008-2009 Daniel P. Berrange
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #ifndef VIRT_VIEWER_EVENT_H
23 #define VIRT_VIEWER_EVENT_H
24
25 #include "virt-viewer-util.h"
26
27 void virt_viewer_events_register(void);
28
29 #endif
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007 Red Hat,
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #include <config.h>
23 #include <locale.h>
24 #include <vncdisplay.h>
25 #include <gtk/gtk.h>
26 #include <glib/gi18n.h>
27 #include <stdlib.h>
28
29 #include "virt-viewer.h"
30
31 static void virt_viewer_version(void)
32 {
33 g_print(_("%s version %s\n"), PACKAGE, VERSION);
34
35 exit(0);
36 }
37
38
39 int main(int argc, char **argv)
40 {
41 GOptionContext *context;
42 GError *error = NULL;
43 int ret = 1;
44 char *uri = NULL;
45 int zoom = 100;
46 gchar **args = NULL;
47 gboolean verbose = FALSE;
48 gboolean debug = FALSE;
49 gboolean direct = FALSE;
50 gboolean waitvm = FALSE;
51 gboolean reconnect = FALSE;
52 gboolean fullscreen = FALSE;
53 const char *help_msg = N_("Run '" PACKAGE " --help' to see a full list of available command line options");
54 const GOptionEntry options [] = {
55 { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
56 virt_viewer_version, N_("display version information"), NULL },
57 { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
58 N_("display verbose information"), NULL },
59 { "direct", 'd', 0, G_OPTION_ARG_NONE, &direct,
60 N_("direct connection with no automatic tunnels"), NULL },
61 { "connect", 'c', 0, G_OPTION_ARG_STRING, &uri,
62 N_("connect to hypervisor"), "URI"},
63 { "wait", 'w', 0, G_OPTION_ARG_NONE, &waitvm,
64 N_("wait for domain to start"), NULL },
65 { "reconnect", 'r', 0, G_OPTION_ARG_NONE, &reconnect,
66 N_("reconnect to domain upon restart"), NULL },
67 { "zoom", 'z', 0, G_OPTION_ARG_INT, &zoom,
68 N_("Zoom level of window, in percentage"), "ZOOM" },
69 { "debug", '\0', 0, G_OPTION_ARG_NONE, &debug,
70 N_("display debugging information"), NULL },
71 { "full-screen", 'f', 0, G_OPTION_ARG_NONE, &fullscreen,
72 N_("Open in full screen mode"), NULL },
73 { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args,
74 NULL, "DOMAIN-NAME|ID|UUID" },
75 { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
76 };
77
78 setlocale(LC_ALL, "");
79 bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
80 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
81 textdomain(GETTEXT_PACKAGE);
82
83 /* Setup command line options */
84 context = g_option_context_new (_("- Virtual machine graphical console"));
85 g_option_context_add_main_entries (context, options, NULL);
86 g_option_context_add_group (context, gtk_get_option_group (TRUE));
87 g_option_context_add_group (context, vnc_display_get_option_group ());
88 g_option_context_parse (context, &argc, &argv, &error);
89 if (error) {
90 g_printerr("%s\n%s\n",
91 error->message,
92 gettext(help_msg));
93 g_error_free(error);
94 goto cleanup;
95 }
96
97 g_option_context_free(context);
98
99 if (!args || (g_strv_length(args) != 1)) {
100 fprintf(stderr, _("\nUsage: %s [OPTIONS] DOMAIN-NAME|ID|UUID\n\n%s\n\n"), argv[0], help_msg);
101 goto cleanup;
102 }
103
104 if (zoom < 10 || zoom > 200) {
105 fprintf(stderr, "Zoom level must be within 10-200\n");
106 goto cleanup;
107 }
108
109 ret = virt_viewer_start(uri, args[0], zoom, direct, waitvm, reconnect, verbose, debug, fullscreen, NULL);
110 if (ret != 0)
111 return ret;
112
113 gtk_main();
114
115 cleanup:
116 g_free(uri);
117 g_strfreev(args);
118
119 return ret;
120 }
121
122 /*
123 * Local variables:
124 * c-indent-level: 8
125 * c-basic-offset: 8
126 * tab-width: 8
127 * indent-tabs-mode: t
128 * End:
129 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23
24 #include <spice-audio.h>
25
26 #include <glib/gi18n.h>
27
28 #include "virt-viewer-util.h"
29 #include "virt-viewer-session-spice.h"
30 #include "virt-viewer-display-spice.h"
31 #include "virt-viewer-auth.h"
32
33 G_DEFINE_TYPE (VirtViewerSessionSpice, virt_viewer_session_spice, VIRT_VIEWER_TYPE_SESSION)
34
35
36 struct _VirtViewerSessionSpicePrivate {
37 SpiceSession *session;
38 SpiceAudio *audio;
39 };
40
41 #define VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpicePrivate))
42
43 static void virt_viewer_session_spice_close(VirtViewerSession *session);
44 static gboolean virt_viewer_session_spice_open_fd(VirtViewerSession *session, int fd);
45 static gboolean virt_viewer_session_spice_open_host(VirtViewerSession *session, char *host, char *port);
46 static gboolean virt_viewer_session_spice_channel_open_fd(VirtViewerSession *session, VirtViewerSessionChannel *channel, int fd);
47 static void virt_viewer_session_spice_channel_new(SpiceSession *s,
48 SpiceChannel *channel,
49 VirtViewerSession *session);
50 static void virt_viewer_session_spice_channel_destroy(SpiceSession *s,
51 SpiceChannel *channel,
52 VirtViewerSession *session);
53
54
55 static void
56 virt_viewer_session_spice_finalize(GObject *obj)
57 {
58 VirtViewerSessionSpice *spice = VIRT_VIEWER_SESSION_SPICE(obj);
59
60 if (spice->priv->session) {
61 spice_session_disconnect(spice->priv->session);
62 g_object_unref(spice->priv->session);
63 }
64 if (spice->priv->audio)
65 g_object_unref(spice->priv->audio);
66
67 G_OBJECT_CLASS(virt_viewer_session_spice_parent_class)->finalize(obj);
68 }
69
70
71 static void
72 virt_viewer_session_spice_class_init(VirtViewerSessionSpiceClass *klass)
73 {
74 VirtViewerSessionClass *dclass = VIRT_VIEWER_SESSION_CLASS(klass);
75 GObjectClass *oclass = G_OBJECT_CLASS(klass);
76
77 oclass->finalize = virt_viewer_session_spice_finalize;
78
79 dclass->close = virt_viewer_session_spice_close;
80 dclass->open_fd = virt_viewer_session_spice_open_fd;
81 dclass->open_host = virt_viewer_session_spice_open_host;
82 dclass->channel_open_fd = virt_viewer_session_spice_channel_open_fd;
83
84 g_type_class_add_private(oclass, sizeof(VirtViewerSessionSpicePrivate));
85 }
86
87 static void
88 virt_viewer_session_spice_init(VirtViewerSessionSpice *self G_GNUC_UNUSED)
89 {
90 self->priv = VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(self);
91 }
92
93 static void
94 virt_viewer_session_spice_close(VirtViewerSession *session)
95 {
96 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
97
98 g_return_if_fail(self != NULL);
99
100 virt_viewer_session_clear_displays(session);
101
102 if (self->priv->session) {
103 spice_session_disconnect(self->priv->session);
104 g_object_unref(self->priv->session);
105
106 if (self->priv->audio)
107 g_object_unref(self->priv->audio);
108 self->priv->audio = NULL;
109 }
110
111 self->priv->session = spice_session_new();
112 g_signal_connect(self->priv->session, "channel-new",
113 G_CALLBACK(virt_viewer_session_spice_channel_new), self);
114 g_signal_connect(self->priv->session, "channel-destroy",
115 G_CALLBACK(virt_viewer_session_spice_channel_destroy), self);
116
117 }
118
119 static gboolean
120 virt_viewer_session_spice_open_host(VirtViewerSession *session,
121 char *host,
122 char *port)
123 {
124 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
125
126 g_return_val_if_fail(self != NULL, FALSE);
127 g_return_val_if_fail(self->priv->session != NULL, FALSE);
128
129 g_object_set(self->priv->session,
130 "host", host,
131 "port", port,
132 NULL);
133
134 return spice_session_connect(self->priv->session);
135 }
136
137 static gboolean
138 virt_viewer_session_spice_open_fd(VirtViewerSession *session,
139 int fd)
140 {
141 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
142
143 g_return_val_if_fail(self != NULL, FALSE);
144
145 return spice_session_open_fd(self->priv->session, fd);
146 }
147
148 static gboolean
149 virt_viewer_session_spice_channel_open_fd(VirtViewerSession *session,
150 VirtViewerSessionChannel *channel,
151 int fd)
152 {
153 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
154
155 g_return_val_if_fail(self != NULL, FALSE);
156
157 return spice_channel_open_fd(SPICE_CHANNEL(channel), fd);
158 }
159
160 static void
161 virt_viewer_session_spice_channel_open_fd_request(SpiceChannel *channel,
162 gint tls G_GNUC_UNUSED,
163 VirtViewerSession *session)
164 {
165 g_signal_emit_by_name(session, "session-channel-open", channel);
166 }
167
168 static void
169 virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED,
170 SpiceChannelEvent event,
171 VirtViewerSession *session)
172 {
173 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
174 char *password = NULL;
175
176 g_return_if_fail(self != NULL);
177
178 switch (event) {
179 case SPICE_CHANNEL_OPENED:
180 DEBUG_LOG("main channel: opened");
181 break;
182 case SPICE_CHANNEL_CLOSED:
183 DEBUG_LOG("main channel: closed");
184 g_signal_emit_by_name(session, "session-disconnected");
185 break;
186 case SPICE_CHANNEL_ERROR_CONNECT:
187 DEBUG_LOG("main channel: failed to connect");
188 g_signal_emit_by_name(session, "session-disconnected");
189 break;
190 case SPICE_CHANNEL_ERROR_AUTH:
191 DEBUG_LOG("main channel: auth failure (wrong password?)");
192 int ret = virt_viewer_auth_collect_credentials("SPICE",
193 NULL,
194 NULL, &password);
195 if (ret < 0) {
196 g_signal_emit_by_name(session, "session-auth-refused",
197 _("Unable to collect credentials"));
198 } else {
199 g_object_set(self->priv->session, "password", password, NULL);
200 spice_session_connect(self->priv->session);
201 }
202 break;
203 default:
204 g_warning("unknown main channel event: %d", event);
205 g_signal_emit_by_name(session, "session-disconnected");
206 break;
207 }
208
209 g_free(password);
210 }
211
212
213 static void
214 virt_viewer_session_spice_channel_new(SpiceSession *s,
215 SpiceChannel *channel,
216 VirtViewerSession *session)
217 {
218 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
219 int id;
220
221 g_return_if_fail(self != NULL);
222
223 g_signal_connect(channel, "open-fd",
224 G_CALLBACK(virt_viewer_session_spice_channel_open_fd_request), self);
225
226 g_object_get(channel, "channel-id", &id, NULL);
227
228 if (SPICE_IS_MAIN_CHANNEL(channel)) {
229 g_signal_connect(channel, "channel-event",
230 G_CALLBACK(virt_viewer_session_spice_main_channel_event), self);
231 }
232
233 if (SPICE_IS_DISPLAY_CHANNEL(channel)) {
234 GtkWidget *display;
235 if (id != 0)
236 return;
237
238 g_signal_emit_by_name(session, "session-connected");
239
240 DEBUG_LOG("new session channel (#%d)", id);
241 display = virt_viewer_display_spice_new(channel,
242 spice_display_new(s, id));
243
244 virt_viewer_session_add_display(VIRT_VIEWER_SESSION(session),
245 VIRT_VIEWER_DISPLAY(display));
246
247 g_signal_emit_by_name(session, "session-initialized");
248 }
249
250 if (SPICE_IS_INPUTS_CHANNEL(channel)) {
251 DEBUG_LOG("new inputs channel");
252 }
253
254 if (SPICE_IS_PLAYBACK_CHANNEL(channel)) {
255 DEBUG_LOG("new audio channel");
256 if (self->priv->audio != NULL)
257 return;
258 self->priv->audio = spice_audio_new(s, NULL, NULL);
259 }
260 }
261
262 static void
263 virt_viewer_session_spice_channel_destroy(G_GNUC_UNUSED SpiceSession *s,
264 SpiceChannel *channel,
265 VirtViewerSession *session)
266 {
267 VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
268 int id;
269
270 g_return_if_fail(self != NULL);
271
272 g_object_get(channel, "channel-id", &id, NULL);
273 if (SPICE_IS_MAIN_CHANNEL(channel)) {
274 DEBUG_LOG("zap main channel");
275 }
276
277 if (SPICE_IS_DISPLAY_CHANNEL(channel)) {
278 DEBUG_LOG("zap session channel (#%d)", id);
279 }
280
281 if (SPICE_IS_PLAYBACK_CHANNEL(channel) && self->priv->audio) {
282 DEBUG_LOG("zap audio channel");
283 g_object_unref(self->priv->audio);
284 self->priv->audio = NULL;
285 }
286 }
287
288 VirtViewerSession *
289 virt_viewer_session_spice_new(void)
290 {
291 VirtViewerSessionSpice *self;
292
293 self = g_object_new(VIRT_VIEWER_TYPE_SESSION_SPICE, NULL);
294
295 self->priv->session = spice_session_new();
296 g_signal_connect(self->priv->session, "channel-new",
297 G_CALLBACK(virt_viewer_session_spice_channel_new), self);
298 g_signal_connect(self->priv->session, "channel-destroy",
299 G_CALLBACK(virt_viewer_session_spice_channel_destroy), self);
300
301 return VIRT_VIEWER_SESSION(self);
302 }
303
304 /*
305 * Local variables:
306 * c-indent-level: 8
307 * c-basic-offset: 8
308 * tab-width: 8
309 * indent-tabs-mode: t
310 * End:
311 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #ifndef _VIRT_VIEWER_SESSION_SPICE_H
24 #define _VIRT_VIEWER_SESSION_SPICE_H
25
26 #include <glib-object.h>
27 #include <spice-widget.h>
28 #include <spice-audio.h>
29
30 #include "virt-viewer-session.h"
31
32 G_BEGIN_DECLS
33
34 #define VIRT_VIEWER_TYPE_SESSION_SPICE virt_viewer_session_spice_get_type()
35
36 #define VIRT_VIEWER_SESSION_SPICE(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpice))
38
39 #define VIRT_VIEWER_SESSION_SPICE_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpiceClass))
41
42 #define VIRT_IS_VIEWER_SESSION_SPICE(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE))
44
45 #define VIRT_IS_VIEWER_SESSION_SPICE_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION_SPICE))
47
48 #define VIRT_VIEWER_SESSION_SPICE_GET_CLASS(obj) \
49 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpiceClass))
50
51 typedef struct _VirtViewerSessionSpice VirtViewerSessionSpice;
52 typedef struct _VirtViewerSessionSpiceClass VirtViewerSessionSpiceClass;
53 typedef struct _VirtViewerSessionSpicePrivate VirtViewerSessionSpicePrivate;
54
55 struct _VirtViewerSessionSpice {
56 VirtViewerSession parent;
57
58 VirtViewerSessionSpicePrivate *priv;
59 };
60
61 struct _VirtViewerSessionSpiceClass {
62 VirtViewerSessionClass parent_class;
63 };
64
65 GType virt_viewer_session_spice_get_type(void);
66
67 VirtViewerSession* virt_viewer_session_spice_new(void);
68
69 G_END_DECLS
70
71 #endif /* _VIRT_VIEWER_SESSION_SPICE_H */
72
73 /*
74 * Local variables:
75 * c-indent-level: 8
76 * c-basic-offset: 8
77 * tab-width: 8
78 * End:
79 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23
24 #include "virt-viewer-auth.h"
25 #include "virt-viewer-session-vnc.h"
26 #include "virt-viewer-display-vnc.h"
27
28 #include <glib/gi18n.h>
29
30 G_DEFINE_TYPE(VirtViewerSessionVnc, virt_viewer_session_vnc, VIRT_VIEWER_TYPE_SESSION)
31
32 struct _VirtViewerSessionVncPrivate {
33 /* XXX we should really just have a VncConnection */
34 VncDisplay *vnc;
35 };
36
37 #define VIRT_VIEWER_SESSION_VNC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncPrivate))
38
39 static void virt_viewer_session_vnc_close(VirtViewerSession* session);
40 static gboolean virt_viewer_session_vnc_open_fd(VirtViewerSession* session, int fd);
41 static gboolean virt_viewer_session_vnc_open_host(VirtViewerSession* session, char *host, char *port);
42 static gboolean virt_viewer_session_vnc_channel_open_fd(VirtViewerSession* session,
43 VirtViewerSessionChannel* channel, int fd);
44
45
46 static void
47 virt_viewer_session_vnc_finalize(GObject *obj)
48 {
49 VirtViewerSessionVnc *vnc = VIRT_VIEWER_SESSION_VNC(obj);
50
51 if (vnc->priv->vnc) {
52 vnc_display_close(vnc->priv->vnc);
53 g_object_unref(vnc->priv->vnc);
54 }
55
56 G_OBJECT_CLASS(virt_viewer_session_vnc_parent_class)->finalize(obj);
57 }
58
59
60 static void
61 virt_viewer_session_vnc_class_init(VirtViewerSessionVncClass *klass)
62 {
63 VirtViewerSessionClass *dclass = VIRT_VIEWER_SESSION_CLASS(klass);
64 GObjectClass *oclass = G_OBJECT_CLASS(klass);
65
66 oclass->finalize = virt_viewer_session_vnc_finalize;
67
68 dclass->close = virt_viewer_session_vnc_close;
69 dclass->open_fd = virt_viewer_session_vnc_open_fd;
70 dclass->open_host = virt_viewer_session_vnc_open_host;
71 dclass->channel_open_fd = virt_viewer_session_vnc_channel_open_fd;
72
73 g_type_class_add_private(oclass, sizeof(VirtViewerSessionVncPrivate));
74 }
75
76 static void
77 virt_viewer_session_vnc_init(VirtViewerSessionVnc *self G_GNUC_UNUSED)
78 {
79 self->priv = VIRT_VIEWER_SESSION_VNC_GET_PRIVATE(self);
80 }
81
82 static void
83 virt_viewer_session_vnc_connected(VncDisplay *vnc G_GNUC_UNUSED,
84 VirtViewerSessionVnc *session)
85 {
86 GtkWidget *display = virt_viewer_display_vnc_new(session->priv->vnc);
87 g_signal_emit_by_name(session, "session-connected");
88 virt_viewer_session_add_display(VIRT_VIEWER_SESSION(session),
89 VIRT_VIEWER_DISPLAY(display));
90 }
91
92 static void
93 virt_viewer_session_vnc_disconnected(VncDisplay *vnc G_GNUC_UNUSED,
94 VirtViewerSessionVnc *session)
95 {
96 g_signal_emit_by_name(session, "session-disconnected");
97 }
98
99 static void
100 virt_viewer_session_vnc_initialized(VncDisplay *vnc G_GNUC_UNUSED,
101 VirtViewerSessionVnc *session)
102 {
103 g_signal_emit_by_name(session, "session-initialized");
104 }
105
106 static void
107 virt_viewer_session_vnc_cut_text(VncDisplay *vnc G_GNUC_UNUSED,
108 const char *text,
109 VirtViewerSession *session)
110 {
111 g_signal_emit_by_name(session, "session-cut-text", text);
112 }
113
114 static void
115 virt_viewer_session_vnc_bell(VncDisplay *vnc G_GNUC_UNUSED,
116 VirtViewerSession *session)
117 {
118 g_signal_emit_by_name(session, "session-bell");
119 }
120
121 static void
122 virt_viewer_session_vnc_auth_unsupported(VncDisplay *vnc G_GNUC_UNUSED,
123 unsigned int authType,
124 VirtViewerSession *session)
125 {
126 char *msg = g_strdup_printf(_("Unsupported authentication type %d"),
127 authType);
128 g_signal_emit_by_name(session, "session-auth-failed", msg);
129 g_free(msg);
130 }
131
132 static void
133 virt_viewer_session_vnc_auth_failure(VncDisplay *vnc G_GNUC_UNUSED,
134 const char *reason,
135 VirtViewerSession *session)
136 {
137
138 g_signal_emit_by_name(session, "session-auth-refused", reason);
139 }
140
141
142
143 static gboolean
144 virt_viewer_session_vnc_open_fd(VirtViewerSession* session,
145 int fd)
146 {
147 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
148
149 g_return_val_if_fail(self != NULL, FALSE);
150 g_return_val_if_fail(self->priv->vnc != NULL, FALSE);
151
152 return vnc_display_open_fd(self->priv->vnc, fd);
153 }
154
155 static gboolean
156 virt_viewer_session_vnc_channel_open_fd(VirtViewerSession* session G_GNUC_UNUSED,
157 VirtViewerSessionChannel* channel G_GNUC_UNUSED,
158 int fd G_GNUC_UNUSED)
159 {
160 g_warning("channel_open_fd is not supported by VNC");
161 return FALSE;
162 }
163
164 static gboolean
165 virt_viewer_session_vnc_open_host(VirtViewerSession* session,
166 char *host,
167 char *port)
168 {
169 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
170
171 g_return_val_if_fail(self != NULL, FALSE);
172 g_return_val_if_fail(self->priv->vnc != NULL, FALSE);
173
174 return vnc_display_open_host(self->priv->vnc, host, port);
175 }
176
177 static void
178 virt_viewer_session_vnc_close(VirtViewerSession* session)
179 {
180 VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
181
182 g_return_if_fail(self != NULL);
183
184 if (self->priv->vnc != NULL) {
185 virt_viewer_session_clear_displays(session);
186 vnc_display_close(self->priv->vnc);
187 g_object_unref(self->priv->vnc);
188 }
189
190 self->priv->vnc = VNC_DISPLAY(vnc_display_new());
191
192 g_signal_connect(self->priv->vnc, "vnc-connected",
193 G_CALLBACK(virt_viewer_session_vnc_connected), session);
194 g_signal_connect(self->priv->vnc, "vnc-initialized",
195 G_CALLBACK(virt_viewer_session_vnc_initialized), session);
196 g_signal_connect(self->priv->vnc, "vnc-disconnected",
197 G_CALLBACK(virt_viewer_session_vnc_disconnected), session);
198
199 g_signal_connect(self->priv->vnc, "vnc-bell",
200 G_CALLBACK(virt_viewer_session_vnc_bell), session);
201 g_signal_connect(self->priv->vnc, "vnc-auth-failure",
202 G_CALLBACK(virt_viewer_session_vnc_auth_failure), session);
203 g_signal_connect(self->priv->vnc, "vnc-auth-unsupported",
204 G_CALLBACK(virt_viewer_session_vnc_auth_unsupported), session);
205 g_signal_connect(self->priv->vnc, "vnc-server-cut-text",
206 G_CALLBACK(virt_viewer_session_vnc_cut_text), session);
207
208 g_signal_connect(self->priv->vnc, "vnc-auth-credential",
209 G_CALLBACK(virt_viewer_auth_vnc_credentials), NULL);
210
211 }
212
213 VirtViewerSession *
214 virt_viewer_session_vnc_new(void)
215 {
216 VirtViewerSessionVnc *session;
217
218 session = g_object_new(VIRT_VIEWER_TYPE_SESSION_VNC, NULL);
219
220 session->priv->vnc = VNC_DISPLAY(vnc_display_new());
221
222 g_signal_connect(session->priv->vnc, "vnc-connected",
223 G_CALLBACK(virt_viewer_session_vnc_connected), session);
224 g_signal_connect(session->priv->vnc, "vnc-initialized",
225 G_CALLBACK(virt_viewer_session_vnc_initialized), session);
226 g_signal_connect(session->priv->vnc, "vnc-disconnected",
227 G_CALLBACK(virt_viewer_session_vnc_disconnected), session);
228
229 g_signal_connect(session->priv->vnc, "vnc-bell",
230 G_CALLBACK(virt_viewer_session_vnc_bell), session);
231 g_signal_connect(session->priv->vnc, "vnc-auth-failure",
232 G_CALLBACK(virt_viewer_session_vnc_auth_failure), session);
233 g_signal_connect(session->priv->vnc, "vnc-auth-unsupported",
234 G_CALLBACK(virt_viewer_session_vnc_auth_unsupported), session);
235 g_signal_connect(session->priv->vnc, "vnc-server-cut-text",
236 G_CALLBACK(virt_viewer_session_vnc_cut_text), session);
237
238 g_signal_connect(session->priv->vnc, "vnc-auth-credential",
239 G_CALLBACK(virt_viewer_auth_vnc_credentials), NULL);
240
241 return VIRT_VIEWER_SESSION(session);
242 }
243
244
245
246
247 /*
248 * Local variables:
249 * c-indent-level: 8
250 * c-basic-offset: 8
251 * tab-width: 8
252 * End:
253 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #ifndef _VIRT_VIEWER_SESSION_VNC_H
24 #define _VIRT_VIEWER_SESSION_VNC_H
25
26 #include <glib-object.h>
27 #include <vncdisplay.h>
28
29 #include "virt-viewer-session.h"
30
31 G_BEGIN_DECLS
32
33 #define VIRT_VIEWER_TYPE_SESSION_VNC virt_viewer_session_vnc_get_type()
34
35 #define VIRT_VIEWER_SESSION_VNC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVnc))
37
38 #define VIRT_VIEWER_SESSION_VNC_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncClass))
40
41 #define VIRT_IS_VIEWER_SESSION_VNC(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION_VNC))
43
44 #define VIRT_IS_VIEWER_SESSION_VNC_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION_VNC))
46
47 #define VIRT_VIEWER_SESSION_VNC_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncClass))
49
50 typedef struct _VirtViewerSessionVnc VirtViewerSessionVnc;
51 typedef struct _VirtViewerSessionVncClass VirtViewerSessionVncClass;
52 typedef struct _VirtViewerSessionVncPrivate VirtViewerSessionVncPrivate;
53
54 struct _VirtViewerSessionVnc {
55 VirtViewerSession parent;
56
57 VirtViewerSessionVncPrivate *priv;
58 };
59
60 struct _VirtViewerSessionVncClass {
61 VirtViewerSessionClass parent_class;
62 };
63
64 GType virt_viewer_session_vnc_get_type(void);
65
66 VirtViewerSession *virt_viewer_session_vnc_new(void);
67
68 G_END_DECLS
69
70 #endif /* _VIRT_VIEWER_SESSION_VNC_H */
71
72 /*
73 * Local variables:
74 * c-indent-level: 8
75 * c-basic-offset: 8
76 * tab-width: 8
77 * End:
78 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23
24 #include <config.h>
25
26 #include <locale.h>
27
28 #include "virt-viewer-session.h"
29 #include "virt-viewer-util.h"
30
31 #define VIRT_VIEWER_SESSION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionPrivate))
32
33
34 struct _VirtViewerSessionPrivate
35 {
36 GList *displays;
37 };
38
39 G_DEFINE_ABSTRACT_TYPE(VirtViewerSession, virt_viewer_session, G_TYPE_OBJECT)
40
41 static void
42 virt_viewer_session_finalize(GObject *obj)
43 {
44 VirtViewerSession *session = VIRT_VIEWER_SESSION(obj);
45 GList *tmp = session->priv->displays;
46
47 while (tmp) {
48 g_object_unref(tmp->data);
49 tmp = tmp->next;
50 }
51 g_list_free(session->priv->displays);
52
53 G_OBJECT_CLASS(virt_viewer_session_parent_class)->finalize(obj);
54 }
55
56 static void
57 virt_viewer_session_class_init(VirtViewerSessionClass *class)
58 {
59 GObjectClass *object_class = G_OBJECT_CLASS(class);
60
61 object_class->finalize = virt_viewer_session_finalize;
62
63 g_signal_new("session-connected",
64 G_OBJECT_CLASS_TYPE(object_class),
65 G_SIGNAL_RUN_FIRST,
66 G_STRUCT_OFFSET(VirtViewerSessionClass, session_connected),
67 NULL, NULL,
68 g_cclosure_marshal_VOID__VOID,
69 G_TYPE_NONE,
70 0);
71
72 g_signal_new("session-initialized",
73 G_OBJECT_CLASS_TYPE(object_class),
74 G_SIGNAL_RUN_FIRST,
75 G_STRUCT_OFFSET(VirtViewerSessionClass, session_initialized),
76 NULL, NULL,
77 g_cclosure_marshal_VOID__VOID,
78 G_TYPE_NONE,
79 0);
80
81 g_signal_new("session-disconnected",
82 G_OBJECT_CLASS_TYPE(object_class),
83 G_SIGNAL_RUN_FIRST,
84 G_STRUCT_OFFSET(VirtViewerSessionClass, session_disconnected),
85 NULL, NULL,
86 g_cclosure_marshal_VOID__VOID,
87 G_TYPE_NONE,
88 0);
89
90 g_signal_new("session-channel-open",
91 G_OBJECT_CLASS_TYPE(object_class),
92 G_SIGNAL_RUN_FIRST,
93 G_STRUCT_OFFSET(VirtViewerSessionClass, session_channel_open),
94 NULL, NULL,
95 g_cclosure_marshal_VOID__OBJECT,
96 G_TYPE_NONE,
97 1,
98 G_TYPE_OBJECT);
99
100 g_signal_new("session-auth-refused",
101 G_OBJECT_CLASS_TYPE(object_class),
102 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
103 G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_refused),
104 NULL,
105 NULL,
106 g_cclosure_marshal_VOID__STRING,
107 G_TYPE_NONE,
108 1,
109 G_TYPE_STRING);
110
111 g_signal_new("session-auth-failed",
112 G_OBJECT_CLASS_TYPE(object_class),
113 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
114 G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_failed),
115 NULL,
116 NULL,
117 g_cclosure_marshal_VOID__STRING,
118 G_TYPE_NONE,
119 1,
120 G_TYPE_STRING);
121
122
123 g_signal_new("session-display-added",
124 G_OBJECT_CLASS_TYPE(object_class),
125 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
126 G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_added),
127 NULL,
128 NULL,
129 g_cclosure_marshal_VOID__OBJECT,
130 G_TYPE_NONE,
131 1,
132 VIRT_VIEWER_TYPE_DISPLAY);
133
134 g_signal_new("session-display-removed",
135 G_OBJECT_CLASS_TYPE(object_class),
136 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
137 G_STRUCT_OFFSET(VirtViewerSessionClass, session_display_removed),
138 NULL,
139 NULL,
140 g_cclosure_marshal_VOID__OBJECT,
141 G_TYPE_NONE,
142 1,
143 VIRT_VIEWER_TYPE_DISPLAY);
144
145 g_signal_new("session-cut-text",
146 G_OBJECT_CLASS_TYPE(object_class),
147 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
148 G_STRUCT_OFFSET(VirtViewerSessionClass, session_cut_text),
149 NULL,
150 NULL,
151 g_cclosure_marshal_VOID__STRING,
152 G_TYPE_NONE,
153 1,
154 G_TYPE_STRING);
155
156 g_signal_new("session-bell",
157 G_OBJECT_CLASS_TYPE(object_class),
158 G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
159 G_STRUCT_OFFSET(VirtViewerSessionClass, session_bell),
160 NULL,
161 NULL,
162 g_cclosure_marshal_VOID__VOID,
163 G_TYPE_NONE,
164 0);
165
166 g_type_class_add_private(object_class, sizeof(VirtViewerSessionPrivate));
167 }
168
169 static void
170 virt_viewer_session_init(VirtViewerSession *session)
171 {
172 session->priv = VIRT_VIEWER_SESSION_GET_PRIVATE(session);
173 }
174
175 GtkWidget*
176 virt_viewer_session_new(void)
177 {
178 return g_object_new(VIRT_VIEWER_TYPE_SESSION, NULL);
179 }
180
181
182 void virt_viewer_session_add_display(VirtViewerSession *session,
183 VirtViewerDisplay *display)
184 {
185 session->priv->displays = g_list_append(session->priv->displays, display);
186 g_object_ref(display);
187 g_signal_emit_by_name(session, "session-display-added", display);
188 }
189
190
191 void virt_viewer_session_remove_display(VirtViewerSession *session,
192 VirtViewerDisplay *display)
193 {
194 if (!g_list_find(session->priv->displays, display))
195 return;
196
197 session->priv->displays = g_list_remove(session->priv->displays, display);
198 g_signal_emit_by_name(session, "session-display-removed", display);
199 g_object_unref(display);
200 }
201
202 void virt_viewer_session_clear_displays(VirtViewerSession *session)
203 {
204 GList *tmp = session->priv->displays;
205
206 while (tmp) {
207 g_signal_emit_by_name(session, "session-display-removed", tmp->data);
208 g_object_unref(tmp->data);
209 tmp = tmp->next;
210 }
211 g_list_free(session->priv->displays);
212 session->priv->displays = NULL;
213 }
214
215
216
217 void virt_viewer_session_close(VirtViewerSession *session)
218 {
219 g_return_if_fail(VIRT_VIEWER_IS_SESSION(session));
220
221 VIRT_VIEWER_SESSION_GET_CLASS(session)->close(session);
222 }
223
224 gboolean virt_viewer_session_open_fd(VirtViewerSession *session, int fd)
225 {
226 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE);
227
228 return VIRT_VIEWER_SESSION_GET_CLASS(session)->open_fd(session, fd);
229 }
230
231 gboolean virt_viewer_session_open_host(VirtViewerSession *session, char *host, char *port)
232 {
233 VirtViewerSessionClass *klass;
234
235 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE);
236
237 klass = VIRT_VIEWER_SESSION_GET_CLASS(session);
238 return klass->open_host(session, host, port);
239 }
240
241 gboolean virt_viewer_session_channel_open_fd(VirtViewerSession *session,
242 VirtViewerSessionChannel *channel, int fd)
243 {
244 g_return_val_if_fail(VIRT_VIEWER_IS_SESSION(session), FALSE);
245
246 return VIRT_VIEWER_SESSION_GET_CLASS(session)->channel_open_fd(session, channel, fd);
247 }
248
249 /*
250 * Local variables:
251 * c-indent-level: 8
252 * c-basic-offset: 8
253 * tab-width: 8
254 * End:
255 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23 #ifndef _VIRT_VIEWER_SESSION_H
24 #define _VIRT_VIEWER_SESSION_H
25
26 #include <gtk/gtk.h>
27
28 #include "virt-viewer-display.h"
29
30 G_BEGIN_DECLS
31
32 #define VIRT_VIEWER_TYPE_SESSION virt_viewer_session_get_type()
33
34 #define VIRT_VIEWER_SESSION(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIRT_VIEWER_TYPE_SESSION, VirtViewerSession))
36
37 #define VIRT_VIEWER_SESSION_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST ((klass), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionClass))
39
40 #define VIRT_VIEWER_IS_SESSION(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIRT_VIEWER_TYPE_SESSION))
42
43 #define VIRT_VIEWER_IS_SESSION_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_TYPE ((klass), VIRT_VIEWER_TYPE_SESSION))
45
46 #define VIRT_VIEWER_SESSION_GET_CLASS(obj) \
47 (G_TYPE_INSTANCE_GET_CLASS ((obj), VIRT_VIEWER_TYPE_SESSION, VirtViewerSessionClass))
48
49 typedef struct _VirtViewerSession VirtViewerSession;
50 typedef struct _VirtViewerSessionClass VirtViewerSessionClass;
51 typedef struct _VirtViewerSessionPrivate VirtViewerSessionPrivate;
52
53 typedef struct _VirtViewerSessionChannel VirtViewerSessionChannel;
54
55
56 /* perhaps this become an interface, and be pushed in gtkvnc and spice? */
57 struct _VirtViewerSession {
58 GObject parent;
59
60 VirtViewerSessionPrivate *priv;
61 };
62
63 struct _VirtViewerSessionClass {
64 GObjectClass parent_class;
65
66 /* virtual methods */
67 void (* close) (VirtViewerSession* session);
68 gboolean (* open_fd) (VirtViewerSession* session, int fd);
69 gboolean (* open_host) (VirtViewerSession* session, char *host, char *port);
70 gboolean (* channel_open_fd) (VirtViewerSession* session, VirtViewerSessionChannel *channel, int fd);
71
72 /* signals */
73 void (*session_connected)(VirtViewerSession *session);
74 void (*session_initialized)(VirtViewerSession *session);
75 void (*session_disconnected)(VirtViewerSession *session);
76 void (*session_auth_refused)(VirtViewerSession *session, const char *msg);
77 void (*session_auth_failed)(VirtViewerSession *session, const char *msg);
78
79 void (*session_channel_open)(VirtViewerSession *session, VirtViewerSessionChannel *channel);
80
81 void (*session_display_added)(VirtViewerSession *session,
82 VirtViewerDisplay *display);
83 void (*session_display_removed)(VirtViewerSession *session,
84 VirtViewerDisplay *display);
85
86 void (*session_cut_text)(VirtViewerSession *session, const char *str);
87 void (*session_bell)(VirtViewerSession *session);
88 };
89
90 GType virt_viewer_session_get_type(void);
91
92 GtkWidget *virt_viewer_session_new(void);
93
94 void virt_viewer_session_add_display(VirtViewerSession *session,
95 VirtViewerDisplay *display);
96 void virt_viewer_session_remove_display(VirtViewerSession *session,
97 VirtViewerDisplay *display);
98 void virt_viewer_session_clear_displays(VirtViewerSession *session);
99
100 void virt_viewer_session_close(VirtViewerSession* session);
101 gboolean virt_viewer_session_open_fd(VirtViewerSession* session, int fd);
102 gboolean virt_viewer_session_open_host(VirtViewerSession* session, char *host, char *port);
103 GObject* virt_viewer_session_get(VirtViewerSession* session);
104 gboolean virt_viewer_session_channel_open_fd(VirtViewerSession* session,
105 VirtViewerSessionChannel* channel, int fd);
106
107 G_END_DECLS
108
109 #endif /* _VIRT_VIEWER_SESSION_H */
110 /*
111 * Local variables:
112 * c-indent-level: 8
113 * c-basic-offset: 8
114 * tab-width: 8
115 * End:
116 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Author: Daniel P. Berrange <berrange@redhat.com>
21 */
22
23 #include <config.h>
24
25 #include <sys/types.h>
26 #include <sys/stat.h>
27 #include <unistd.h>
28
29 #include "virt-viewer-util.h"
30
31 GtkBuilder *virt_viewer_util_load_ui(const char *name)
32 {
33 struct stat sb;
34 GtkBuilder *builder;
35 GError *error = NULL;
36
37 builder = gtk_builder_new();
38 if (stat(name, &sb) >= 0) {
39 gtk_builder_add_from_file(builder, name, &error);
40 } else {
41 gchar *path = g_strdup_printf("%s/%s", BUILDER_XML_DIR, name);
42 gtk_builder_add_from_file(builder, path, &error);
43 g_free(path);
44 }
45
46 if (error)
47 g_error("Cannot load UI description %s: %s", name,
48 error->message);
49
50 return builder;
51 }
52
53
54 /*
55 * Local variables:
56 * c-indent-level: 8
57 * c-basic-offset: 8
58 * tab-width: 8
59 * End:
60 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Author: Daniel P. Berrange <berrange@redhat.com>
21 */
22
23 #ifndef VIRT_VIEWER_UTIL_H
24 #define VIRT_VIEWER_UTIL_H
25
26 #include <gtk/gtk.h>
27
28 extern gboolean doDebug;
29
30 #define DEBUG_LOG(s, ...) do { if (doDebug) g_debug(s, ## __VA_ARGS__); } while (0)
31 #define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
32
33
34 GtkBuilder *virt_viewer_util_load_ui(const char *name);
35
36 #endif
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007-2009 Red Hat,
4 * Copyright (C) 2009 Daniel P. Berrange
5 * Copyright (C) 2010 Marc-André Lureau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Daniel P. Berrange <berrange@redhat.com>
22 */
23
24 #include <config.h>
25
26 #include <gdk/gdkkeysyms.h>
27 #include <gtk/gtk.h>
28 #include <sys/types.h>
29 #include <sys/stat.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <unistd.h>
33 #include <locale.h>
34 #include <glib/gprintf.h>
35 #include <glib/gi18n.h>
36
37 #include <libvirt/libvirt.h>
38 #include <libvirt/virterror.h>
39 #include <libxml/xpath.h>
40 #include <libxml/uri.h>
41
42
43 #ifdef HAVE_SYS_SOCKET_H
44 #include <sys/socket.h>
45 #endif
46
47 #ifdef HAVE_SYS_UN_H
48 #include <sys/un.h>
49 #endif
50
51 #ifdef HAVE_WINDOWS_H
52 #include <windows.h>
53 #endif
54
55 #include "virt-viewer.h"
56 #include "virt-viewer-events.h"
57 #include "virt-viewer-auth.h"
58 #include "virt-viewer-session-vnc.h"
59
60 #ifdef HAVE_SPICE_GTK
61 #include "virt-viewer-session-spice.h"
62 #endif
63
64 #include "view/autoDrawer.h"
65
66 gboolean doDebug = FALSE;
67
68 /* Signal handlers for main window */
69 void virt_viewer_menu_view_zoom_out(GtkWidget *menu, VirtViewer *viewer);
70 void virt_viewer_menu_view_zoom_in(GtkWidget *menu, VirtViewer *viewer);
71 void virt_viewer_menu_view_zoom_reset(GtkWidget *menu, VirtViewer *viewer);
72 void virt_viewer_delete(GtkWidget *src, void *dummy, VirtViewer *viewer);
73 void virt_viewer_menu_file_quit(GtkWidget *src, VirtViewer *viewer);
74 void virt_viewer_menu_help_about(GtkWidget *menu, VirtViewer *viewer);
75 void virt_viewer_menu_view_fullscreen(GtkWidget *menu, VirtViewer *viewer);
76 void virt_viewer_menu_view_resize(GtkWidget *menu, VirtViewer *viewer);
77 void virt_viewer_menu_send(GtkWidget *menu, VirtViewer *viewer);
78 void virt_viewer_menu_file_screenshot(GtkWidget *menu, VirtViewer *viewer);
79
80 /* Signal handlers for about dialog */
81 void virt_viewer_about_close(GtkWidget *dialog, VirtViewer *viewer);
82 void virt_viewer_about_delete(GtkWidget *dialog, void *dummy, VirtViewer *viewer);
83
84
85 /* Internal methods */
86 static void virt_viewer_connected(VirtViewerSession *session,
87 VirtViewer *viewer);
88 static void virt_viewer_initialized(VirtViewerSession *session,
89 VirtViewer *viewer);
90 static void virt_viewer_disconnected(VirtViewerSession *session,
91 VirtViewer *viewer);
92 static void virt_viewer_auth_refused(VirtViewerSession *session,
93 const char *msg,
94 VirtViewer *viewer);
95 static void virt_viewer_auth_failed(VirtViewerSession *session,
96 const char *msg,
97 VirtViewer *viewer);
98
99 static void virt_viewer_server_cut_text(VirtViewerSession *session,
100 const gchar *text,
101 VirtViewer *viewer);
102 static void virt_viewer_bell(VirtViewerSession *session,
103 VirtViewer *viewer);
104 static void virt_viewer_enable_modifiers(VirtViewer *viewer);
105 static void virt_viewer_disable_modifiers(VirtViewer *viewer);
106 static void virt_viewer_resize_main_window(VirtViewer *viewer);
107
108 static void virt_viewer_set_status(VirtViewer *viewer, const char *text);
109 static void virt_viewer_set_title(VirtViewer *viewer, gboolean grabbed);
110 static void virt_viewer_channel_open(VirtViewerSession *session,
111 VirtViewerSessionChannel *channel,
112 VirtViewer *viewer);
113 static void virt_viewer_quit(VirtViewer *viewer);
114
115 static void virt_viewer_simple_message_dialog(GtkWidget *window, const char *fmt, ...);
116
117
118 #if GTK_CHECK_VERSION(3, 0, 0)
119 #define GDK_Control_L GDK_KEY_Control_L
120 #define GDK_Alt_L GDK_KEY_Alt_L
121 #define GDK_Delete GDK_KEY_Delete
122 #define GDK_BackSpace GDK_KEY_BackSpace
123 #define GDK_Print GDK_KEY_Print
124 #define GDK_F1 GDK_KEY_F1
125 #define GDK_F2 GDK_KEY_F2
126 #define GDK_F3 GDK_KEY_F3
127 #define GDK_F4 GDK_KEY_F4
128 #define GDK_F5 GDK_KEY_F5
129 #define GDK_F6 GDK_KEY_F6
130 #define GDK_F7 GDK_KEY_F7
131 #define GDK_F8 GDK_KEY_F8
132 #define GDK_F9 GDK_KEY_F9
133 #define GDK_F10 GDK_KEY_F10
134 #define GDK_F11 GDK_KEY_F11
135 #define GDK_F12 GDK_KEY_F12
136 #endif
137
138 enum menuNums {
139 FILE_MENU,
140 VIEW_MENU,
141 SEND_KEY_MENU,
142 HELP_MENU,
143 LAST_MENU // sentinel
144 };
145
146 struct _VirtViewer {
147 char *uri;
148 virConnectPtr conn;
149 char *domkey;
150 char *domtitle;
151
152 GtkBuilder *builder;
153 GtkWidget *window;
154 GtkWidget *container;
155
156 GtkWidget *notebook;
157 GtkWidget *status;
158
159 GtkWidget *toolbar;
160 GtkWidget *layout;
161
162 char *pretty_address;
163
164 gboolean autoResize;
165 gboolean fullscreen;
166 gboolean withEvents;
167
168 gboolean active;
169
170 gboolean accelEnabled;
171 GValue accelSetting;
172 GSList *accelList;
173 int accelMenuSig[LAST_MENU];
174
175 gboolean waitvm;
176 gboolean reconnect;
177 gboolean direct;
178 gboolean verbose;
179 gboolean authretry;
180 gboolean connected;
181
182 gchar *clipboard;
183
184 GtkWidget *display;
185 VirtViewerSession *session;
186
187 gint zoomlevel;
188
189 char *unixsock;
190 char *ghost;
191 char *gport;
192 char *host;
193 char *transport;
194 char *user;
195 int port;
196 };
197
198 static const char * const menuNames[LAST_MENU] = {
199 "menu-file", "menu-view", "menu-send", "menu-help"
200 };
201
202
203 #define MAX_KEY_COMBO 3
204 struct keyComboDef {
205 guint keys[MAX_KEY_COMBO];
206 guint nkeys;
207 const char *label;
208 };
209
210 static const struct keyComboDef keyCombos[] = {
211 { { GDK_Control_L, GDK_Alt_L, GDK_Delete }, 3, "Ctrl+Alt+_Del"},
212 { { GDK_Control_L, GDK_Alt_L, GDK_BackSpace }, 3, "Ctrl+Alt+_Backspace"},
213 { {}, 0, "" },
214 { { GDK_Control_L, GDK_Alt_L, GDK_F1 }, 3, "Ctrl+Alt+F_1"},
215 { { GDK_Control_L, GDK_Alt_L, GDK_F2 }, 3, "Ctrl+Alt+F_2"},
216 { { GDK_Control_L, GDK_Alt_L, GDK_F3 }, 3, "Ctrl+Alt+F_3"},
217 { { GDK_Control_L, GDK_Alt_L, GDK_F4 }, 3, "Ctrl+Alt+F_4"},
218 { { GDK_Control_L, GDK_Alt_L, GDK_F5 }, 3, "Ctrl+Alt+F_5"},
219 { { GDK_Control_L, GDK_Alt_L, GDK_F6 }, 3, "Ctrl+Alt+F_6"},
220 { { GDK_Control_L, GDK_Alt_L, GDK_F7 }, 3, "Ctrl+Alt+F_7"},
221 { { GDK_Control_L, GDK_Alt_L, GDK_F8 }, 3, "Ctrl+Alt+F_8"},
222 { { GDK_Control_L, GDK_Alt_L, GDK_F5 }, 3, "Ctrl+Alt+F_9"},
223 { { GDK_Control_L, GDK_Alt_L, GDK_F6 }, 3, "Ctrl+Alt+F1_0"},
224 { { GDK_Control_L, GDK_Alt_L, GDK_F7 }, 3, "Ctrl+Alt+F11"},
225 { { GDK_Control_L, GDK_Alt_L, GDK_F8 }, 3, "Ctrl+Alt+F12"},
226 { {}, 0, "" },
227 { { GDK_Print }, 1, "_PrintScreen"},
228 };
229
230
231 static gboolean virt_viewer_connect_timer(void *opaque);
232 static int virt_viewer_initial_connect(VirtViewer *viewer);
233
234
235 void
236 virt_viewer_simple_message_dialog(GtkWidget *window,
237 const char *fmt, ...)
238 {
239 GtkWidget *dialog;
240 char *msg;
241 va_list vargs;
242
243 va_start(vargs, fmt);
244
245 msg = g_strdup_vprintf(fmt, vargs);
246
247 va_end(vargs);
248
249 dialog = gtk_message_dialog_new(GTK_WINDOW(window),
250 GTK_DIALOG_MODAL |
251 GTK_DIALOG_DESTROY_WITH_PARENT,
252 GTK_MESSAGE_ERROR,
253 GTK_BUTTONS_OK,
254 "%s",
255 msg);
256
257 gtk_dialog_run(GTK_DIALOG(dialog));
258
259 gtk_widget_destroy(dialog);
260
261 g_free(msg);
262 }
263
264
265 /*
266 * This code attempts to resize the top level window to be large enough
267 * to contain the entire display desktop at 1:1 ratio. If the local desktop
268 * isn't large enough that it goes as large as possible and lets the display
269 * scale down to fit, maintaining aspect ratio
270 */
271 static void
272 virt_viewer_resize_main_window(VirtViewer *viewer)
273 {
274 GdkRectangle fullscreen;
275 GdkScreen *screen;
276 int width, height;
277 double desktopAspect;
278 double screenAspect;
279 guint desktopWidth;
280 guint desktopHeight;
281
282 DEBUG_LOG("Preparing main window resize");
283 if (!viewer->active) {
284 DEBUG_LOG("Skipping inactive resize");
285 return;
286 }
287
288 gtk_window_resize(GTK_WINDOW(viewer->window), 1, 1);
289
290 virt_viewer_display_get_desktop_size(VIRT_VIEWER_DISPLAY(viewer->display),
291 &desktopWidth, &desktopHeight);
292
293 screen = gtk_widget_get_screen(viewer->window);
294 gdk_screen_get_monitor_geometry(screen,
295 gdk_screen_get_monitor_at_window
296 (screen, gtk_widget_get_window(viewer->window)),
297 &fullscreen);
298
299 desktopAspect = (double)desktopWidth / (double)desktopHeight;
300 screenAspect = (double)(fullscreen.width - 128) / (double)(fullscreen.height - 128);
301
302 if ((desktopWidth > (fullscreen.width - 128)) ||
303 (desktopHeight > (fullscreen.height - 128))) {
304 /* Doesn't fit native res, so go as large as possible
305 maintaining aspect ratio */
306 if (screenAspect > desktopAspect) {
307 width = desktopHeight * desktopAspect;
308 height = desktopHeight;
309 } else {
310 width = desktopWidth;
311 height = desktopWidth / desktopAspect;
312 }
313 } else {
314 width = desktopWidth;
315 height = desktopHeight;
316 }
317
318 DEBUG_LOG("Decided todo %dx%d (desktop is %dx%d, fullscreen is %dx%d",
319 width, height, desktopWidth, desktopHeight,
320 fullscreen.width, fullscreen.height);
321
322 virt_viewer_display_set_desktop_size(VIRT_VIEWER_DISPLAY(viewer->display),
323 width, height);
324 }
325
326 static void
327 virt_viewer_desktop_resize(VirtViewerDisplay *display G_GNUC_UNUSED,
328 VirtViewer *viewer)
329 {
330 if (viewer->autoResize && viewer->window && !viewer->fullscreen)
331 virt_viewer_resize_main_window(viewer);
332 }
333
334
335 void
336 virt_viewer_menu_view_zoom_out(GtkWidget *menu G_GNUC_UNUSED,
337 VirtViewer *viewer)
338 {
339 gtk_window_resize(GTK_WINDOW(viewer->window), 1, 1);
340 if (viewer->zoomlevel > 10)
341 viewer->zoomlevel -= 10;
342
343 if (viewer->display)
344 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(viewer->display), viewer->zoomlevel);
345 }
346
347 void
348 virt_viewer_menu_view_zoom_in(GtkWidget *menu G_GNUC_UNUSED,
349 VirtViewer *viewer)
350 {
351 gtk_window_resize(GTK_WINDOW(viewer->window), 1, 1);
352 if (viewer->zoomlevel < 400)
353 viewer->zoomlevel += 10;
354
355 if (viewer->display)
356 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(viewer->display), viewer->zoomlevel);
357 }
358
359 void
360 virt_viewer_menu_view_zoom_reset(GtkWidget *menu G_GNUC_UNUSED,
361 VirtViewer *viewer)
362 {
363 gtk_window_resize(GTK_WINDOW(viewer->window), 1, 1);
364 viewer->zoomlevel = 100;
365
366 if (viewer->display)
367 virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(viewer->display), viewer->zoomlevel);
368 }
369
370 void
371 virt_viewer_set_title(VirtViewer *viewer,
372 gboolean grabbed)
373 {
374 char *title;
375 const char *subtitle;
376
377 if (!viewer->window)
378 return;
379
380 if (grabbed)
381 subtitle = "(Press Ctrl+Alt to release pointer) ";
382 else
383 subtitle = "";
384
385 if (viewer->domtitle)
386 title = g_strdup_printf("%s%s - Virt Viewer",
387 subtitle, viewer->domtitle);
388 else
389 title = g_strdup("Virt Viewer");
390
391 gtk_window_set_title(GTK_WINDOW(viewer->window), title);
392
393 g_free(title);
394 }
395
396 static gboolean
397 virt_viewer_ignore_accel(GtkWidget *menu G_GNUC_UNUSED,
398 VirtViewer *viewer G_GNUC_UNUSED)
399 {
400 /* ignore accelerator */
401 return TRUE;
402 }
403
404
405 void
406 virt_viewer_disable_modifiers(VirtViewer *viewer)
407 {
408 GtkSettings *settings = gtk_settings_get_default();
409 GValue empty;
410 GSList *accels;
411 int i;
412
413 if (!viewer->window)
414 return;
415
416 if (!viewer->accelEnabled)
417 return;
418
419 /* This stops F10 activating menu bar */
420 memset(&empty, 0, sizeof empty);
421 g_value_init(&empty, G_TYPE_STRING);
422 g_object_get_property(G_OBJECT(settings), "gtk-menu-bar-accel", &viewer->accelSetting);
423 g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &empty);
424
425 /* This stops global accelerators like Ctrl+Q == Quit */
426 for (accels = viewer->accelList ; accels ; accels = accels->next) {
427 gtk_window_remove_accel_group(GTK_WINDOW(viewer->window), accels->data);
428 }
429
430 /* This stops menu bar shortcuts like Alt+F == File */
431 for (i = 0 ; i < LAST_MENU ; i++) {
432 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(viewer->builder, menuNames[i]));
433 viewer->accelMenuSig[i] =
434 g_signal_connect(menu, "mnemonic-activate",
435 G_CALLBACK(virt_viewer_ignore_accel), viewer);
436 }
437
438 viewer->accelEnabled = FALSE;
439 }
440
441
442 void
443 virt_viewer_enable_modifiers(VirtViewer *viewer)
444 {
445 GtkSettings *settings = gtk_settings_get_default();
446 GSList *accels;
447 int i;
448
449 if (!viewer->window)
450 return;
451
452 if (viewer->accelEnabled)
453 return;
454
455 /* This allows F10 activating menu bar */
456 g_object_set_property(G_OBJECT(settings), "gtk-menu-bar-accel", &viewer->accelSetting);
457
458 /* This allows global accelerators like Ctrl+Q == Quit */
459 for (accels = viewer->accelList ; accels ; accels = accels->next) {
460 gtk_window_add_accel_group(GTK_WINDOW(viewer->window), accels->data);
461 }
462
463 /* This allows menu bar shortcuts like Alt+F == File */
464 for (i = 0 ; i < LAST_MENU ; i++) {
465 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(viewer->builder, menuNames[i]));
466 g_signal_handler_disconnect(menu, viewer->accelMenuSig[i]);
467 }
468
469 viewer->accelEnabled = TRUE;
470 }
471
472 void
473 virt_viewer_quit(VirtViewer *viewer)
474 {
475 g_return_if_fail(viewer != NULL);
476
477 if (viewer->session)
478 virt_viewer_session_close(VIRT_VIEWER_SESSION(viewer->session));
479 gtk_main_quit();
480 }
481
482 void
483 virt_viewer_delete(GtkWidget *src G_GNUC_UNUSED,
484 void *dummy G_GNUC_UNUSED,
485 VirtViewer *viewer)
486 {
487 virt_viewer_quit(viewer);
488 }
489
490 void
491 virt_viewer_menu_file_quit(GtkWidget *src G_GNUC_UNUSED,
492 VirtViewer *viewer)
493 {
494 virt_viewer_quit(viewer);
495 }
496
497
498 static void
499 virt_viewer_leave_fullscreen(VirtViewer *viewer)
500 {
501 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(viewer->builder, "top-menu"));
502 if (!viewer->fullscreen)
503 return;
504 viewer->fullscreen = FALSE;
505 ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(viewer->layout), FALSE);
506 gtk_widget_show(menu);
507 gtk_widget_hide(viewer->toolbar);
508 gtk_window_unfullscreen(GTK_WINDOW(viewer->window));
509 if (viewer->autoResize)
510 virt_viewer_resize_main_window(viewer);
511 }
512
513 static void
514 virt_viewer_enter_fullscreen(VirtViewer *viewer)
515 {
516 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(viewer->builder, "top-menu"));
517 if (viewer->fullscreen)
518 return;
519 viewer->fullscreen = TRUE;
520 gtk_widget_hide(menu);
521 gtk_window_fullscreen(GTK_WINDOW(viewer->window));
522 gtk_widget_show(viewer->toolbar);
523 ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(viewer->layout), TRUE);
524 }
525
526 static gboolean
527 window_state_cb(GtkWidget *widget G_GNUC_UNUSED, GdkEventWindowState *event,
528 gpointer data)
529 {
530 VirtViewer *viewer = data;
531
532 if (!(event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN))
533 return TRUE;
534
535 if (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)
536 virt_viewer_enter_fullscreen(viewer);
537 else
538 virt_viewer_leave_fullscreen(viewer);
539
540 return TRUE;
541 }
542
543 static void
544 virt_viewer_toolbar_leave_fullscreen(GtkWidget *button G_GNUC_UNUSED,
545 VirtViewer *viewer)
546 {
547 GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(viewer->builder, "menu-view-fullscreen"));
548
549 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), FALSE);
550 virt_viewer_leave_fullscreen(viewer);
551 }
552
553
554 void
555 virt_viewer_menu_view_fullscreen(GtkWidget *menu,
556 VirtViewer *viewer)
557 {
558 if (!viewer->window)
559 return;
560
561 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) {
562 virt_viewer_enter_fullscreen(viewer);
563 } else {
564 virt_viewer_leave_fullscreen(viewer);
565 }
566 }
567
568 void
569 virt_viewer_menu_view_resize(GtkWidget *menu,
570 VirtViewer *viewer)
571 {
572 if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) {
573 viewer->autoResize = TRUE;
574 if (!viewer->fullscreen)
575 virt_viewer_resize_main_window(viewer);
576 } else {
577 viewer->autoResize = FALSE;
578 }
579 }
580
581 void
582 virt_viewer_menu_send(GtkWidget *menu G_GNUC_UNUSED,
583 VirtViewer *viewer)
584 {
585 int i;
586 GtkWidget *label = gtk_bin_get_child(GTK_BIN(menu));
587 const char *text = gtk_label_get_label(GTK_LABEL(label));
588
589 for (i = 0 ; i < G_N_ELEMENTS(keyCombos) ; i++) {
590 if (!strcmp(text, keyCombos[i].label)) {
591 DEBUG_LOG("Sending key combo %s", gtk_label_get_text(GTK_LABEL(label)));
592 virt_viewer_display_send_keys(VIRT_VIEWER_DISPLAY(viewer->display),
593 keyCombos[i].keys,
594 keyCombos[i].nkeys);
595 return;
596 }
597 }
598 DEBUG_LOG("Failed to find key combo %s", gtk_label_get_text(GTK_LABEL(label)));
599 }
600
601
602 static void
603 virt_viewer_save_screenshot(VirtViewer *viewer,
604 const char *file)
605 {
606 GdkPixbuf *pix = virt_viewer_display_get_pixbuf(VIRT_VIEWER_DISPLAY(viewer->display));
607 gdk_pixbuf_save(pix, file, "png", NULL,
608 "tEXt::Generator App", PACKAGE, NULL);
609 gdk_pixbuf_unref(pix);
610 }
611
612
613 void
614 virt_viewer_menu_file_screenshot(GtkWidget *menu G_GNUC_UNUSED,
615 VirtViewer *viewer)
616 {
617 GtkWidget *dialog;
618
619 g_return_if_fail(viewer->display != NULL);
620
621 dialog = gtk_file_chooser_dialog_new ("Save screenshot",
622 NULL,
623 GTK_FILE_CHOOSER_ACTION_SAVE,
624 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
625 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
626 NULL);
627 gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
628
629 //gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), default_folder_for_saving);
630 //gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "Screenshot");
631
632 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
633 char *filename;
634
635 filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
636 virt_viewer_save_screenshot(viewer, filename);
637 g_free (filename);
638 }
639
640 gtk_widget_destroy (dialog);
641 }
642
643 void
644 virt_viewer_about_close(GtkWidget *dialog,
645 VirtViewer *viewer G_GNUC_UNUSED)
646 {
647 gtk_widget_hide(dialog);
648 gtk_widget_destroy(dialog);
649 }
650
651 void
652 virt_viewer_about_delete(GtkWidget *dialog,
653 void *dummy G_GNUC_UNUSED,
654 VirtViewer *viewer G_GNUC_UNUSED)
655 {
656 gtk_widget_hide(dialog);
657 gtk_widget_destroy(dialog);
658 }
659
660 void
661 virt_viewer_menu_help_about(GtkWidget *menu G_GNUC_UNUSED,
662 VirtViewer *viewer)
663 {
664 GtkBuilder *about = virt_viewer_util_load_ui("virt-viewer-about.xml");
665
666 GtkWidget *dialog = GTK_WIDGET(gtk_builder_get_object(about, "about"));
667 gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), VERSION);
668
669 gtk_builder_connect_signals(about, viewer);
670
671 gtk_widget_show_all(dialog);
672
673 g_object_unref(G_OBJECT(about));
674 }
675
676
677 static int
678 virt_viewer_parse_uuid(const char *name,
679 unsigned char *uuid)
680 {
681 int i;
682
683 const char *cur = name;
684 for (i = 0;i < 16;) {
685 uuid[i] = 0;
686 if (*cur == 0)
687 return -1;
688 if ((*cur == '-') || (*cur == ' ')) {
689 cur++;
690 continue;
691 }
692 if ((*cur >= '0') && (*cur <= '9'))
693 uuid[i] = *cur - '0';
694 else if ((*cur >= 'a') && (*cur <= 'f'))
695 uuid[i] = *cur - 'a' + 10;
696 else if ((*cur >= 'A') && (*cur <= 'F'))
697 uuid[i] = *cur - 'A' + 10;
698 else
699 return -1;
700 uuid[i] *= 16;
701 cur++;
702 if (*cur == 0)
703 return -1;
704 if ((*cur >= '0') && (*cur <= '9'))
705 uuid[i] += *cur - '0';
706 else if ((*cur >= 'a') && (*cur <= 'f'))
707 uuid[i] += *cur - 'a' + 10;
708 else if ((*cur >= 'A') && (*cur <= 'F'))
709 uuid[i] += *cur - 'A' + 10;
710 else
711 return -1;
712 i++;
713 cur++;
714 }
715
716 return 0;
717 }
718
719
720 static virDomainPtr
721 virt_viewer_lookup_domain(VirtViewer *viewer)
722 {
723 char *end;
724 int id = strtol(viewer->domkey, &end, 10);
725 virDomainPtr dom = NULL;
726 unsigned char uuid[16];
727
728 if (id >= 0 && end && !*end) {
729 dom = virDomainLookupByID(viewer->conn, id);
730 }
731 if (!dom && virt_viewer_parse_uuid(viewer->domkey, uuid) == 0) {
732 dom = virDomainLookupByUUID(viewer->conn, uuid);
733 }
734 if (!dom) {
735 dom = virDomainLookupByName(viewer->conn, viewer->domkey);
736 }
737 return dom;
738 }
739
740 static int
741 virt_viewer_matches_domain(VirtViewer *viewer,
742 virDomainPtr dom)
743 {
744 char *end;
745 const char *name;
746 int id = strtol(viewer->domkey, &end, 10);
747 unsigned char wantuuid[16];
748 unsigned char domuuid[16];
749
750 if (id >= 0 && end && !*end) {
751 if (virDomainGetID(dom) == id)
752 return 1;
753 }
754 if (virt_viewer_parse_uuid(viewer->domkey, wantuuid) == 0) {
755 virDomainGetUUID(dom, domuuid);
756 if (memcmp(wantuuid, domuuid, VIR_UUID_BUFLEN) == 0)
757 return 1;
758 }
759
760 name = virDomainGetName(dom);
761 if (strcmp(name, viewer->domkey) == 0)
762 return 1;
763
764 return 0;
765 }
766
767 static char *
768 virt_viewer_extract_xpath_string(const gchar *xmldesc,
769 const gchar *xpath)
770 {
771 xmlDocPtr xml = NULL;
772 xmlParserCtxtPtr pctxt = NULL;
773 xmlXPathContextPtr ctxt = NULL;
774 xmlXPathObjectPtr obj = NULL;
775 char *port = NULL;
776
777 pctxt = xmlNewParserCtxt();
778 if (!pctxt || !pctxt->sax)
779 goto error;
780
781 xml = xmlCtxtReadDoc(pctxt, (const xmlChar *)xmldesc, "domain.xml", NULL,
782 XML_PARSE_NOENT | XML_PARSE_NONET |
783 XML_PARSE_NOWARNING);
784 if (!xml)
785 goto error;
786
787 ctxt = xmlXPathNewContext(xml);
788 if (!ctxt)
789 goto error;
790
791 obj = xmlXPathEval((const xmlChar *)xpath, ctxt);
792 if (!obj || obj->type != XPATH_STRING || !obj->stringval || !obj->stringval[0])
793 goto error;
794 if (!strcmp((const char*)obj->stringval, "-1"))
795 goto error;
796
797 port = g_strdup((const char*)obj->stringval);
798 xmlXPathFreeObject(obj);
799 obj = NULL;
800
801 error:
802 if (obj)
803 xmlXPathFreeObject(obj);
804 if (ctxt)
805 xmlXPathFreeContext(ctxt);
806 if (xml)
807 xmlFreeDoc(xml);
808 if (pctxt)
809 xmlFreeParserCtxt(pctxt);
810 return port;
811 }
812
813
814 static int
815 virt_viewer_extract_host(const char *uristr,
816 char **host,
817 char **transport,
818 char **user,
819 int *port)
820 {
821 xmlURIPtr uri;
822 char *offset;
823
824 *host = NULL;
825 *transport = NULL;
826 *user = NULL;
827
828 if (uristr == NULL ||
829 !g_strcasecmp(uristr, "xen"))
830 uristr = "xen:///";
831
832 uri = xmlParseURI(uristr);
833 if (!uri || !uri->server) {
834 *host = g_strdup("localhost");
835 } else {
836 *host = g_strdup(uri->server);
837 }
838
839 if (uri->user)
840 *user = g_strdup(uri->user);
841 *port = uri->port;
842
843 offset = strchr(uri->scheme, '+');
844 if (offset)
845 *transport = g_strdup(offset+1);
846
847 xmlFreeURI(uri);
848 return 0;
849 }
850
851 #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
852
853 static int
854 virt_viewer_open_tunnel(const char **cmd)
855 {
856 int fd[2];
857 pid_t pid;
858
859 if (socketpair(PF_UNIX, SOCK_STREAM, 0, fd) < 0)
860 return -1;
861
862 pid = fork();
863 if (pid == -1) {
864 close(fd[0]);
865 close(fd[1]);
866 return -1;
867 }
868
869 if (pid == 0) { /* child */
870 close(fd[0]);
871 close(0);
872 close(1);
873 if (dup(fd[1]) < 0)
874 _exit(1);
875 if (dup(fd[1]) < 0)
876 _exit(1);
877 close(fd[1]);
878 execvp("ssh", (char *const*)cmd);
879 _exit(1);
880 }
881 close(fd[1]);
882 return fd[0];
883 }
884
885
886 static int
887 virt_viewer_open_tunnel_ssh(const char *sshhost,
888 int sshport,
889 const char *sshuser,
890 const char *host,
891 const char *port,
892 const char *unixsock)
893 {
894 const char *cmd[10];
895 char portstr[50];
896 int n = 0;
897
898 if (!sshport)
899 sshport = 22;
900
901 sprintf(portstr, "%d", sshport);
902
903 cmd[n++] = "ssh";
904 cmd[n++] = "-p";
905 cmd[n++] = portstr;
906 if (sshuser) {
907 cmd[n++] = "-l";
908 cmd[n++] = sshuser;
909 }
910 cmd[n++] = sshhost;
911 cmd[n++] = "nc";
912 if (port) {
913 cmd[n++] = host;
914 cmd[n++] = port;
915 } else {
916 cmd[n++] = "-U";
917 cmd[n++] = unixsock;
918 }
919 cmd[n++] = NULL;
920
921 return virt_viewer_open_tunnel(cmd);
922 }
923
924 static int
925 virt_viewer_open_unix_sock(const char *unixsock)
926 {
927 struct sockaddr_un addr;
928 int fd;
929
930 memset(&addr, 0, sizeof addr);
931 addr.sun_family = AF_UNIX;
932 strcpy(addr.sun_path, unixsock);
933
934 if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
935 return -1;
936
937 if (connect(fd, (struct sockaddr *)&addr, sizeof addr) < 0) {
938 close(fd);
939 return -1;
940 }
941
942 return fd;
943 }
944
945 #endif /* defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK) */
946
947 static void
948 virt_viewer_trace(VirtViewer *viewer,
949 const char *fmt, ...)
950 {
951 va_list ap;
952
953 if (doDebug) {
954 va_start(ap, fmt);
955 g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, fmt, ap);
956 va_end(ap);
957 }
958
959 if (viewer->verbose) {
960 va_start(ap, fmt);
961 g_vprintf(fmt, ap);
962 va_end(ap);
963 }
964 }
965
966
967 void
968 virt_viewer_set_status(VirtViewer *viewer,
969 const char *text)
970 {
971 gtk_notebook_set_current_page(GTK_NOTEBOOK(viewer->notebook), 0);
972 gtk_label_set_text(GTK_LABEL(viewer->status), text);
973 }
974
975
976 static void
977 virt_viewer_show_display(VirtViewer *viewer)
978 {
979 g_return_if_fail(viewer != NULL);
980 g_return_if_fail(viewer->display != NULL);
981
982 gtk_widget_grab_focus(gtk_bin_get_child(GTK_BIN(viewer->display)));
983 gtk_notebook_set_current_page(GTK_NOTEBOOK(viewer->notebook), 1);
984 }
985
986 static void
987 virt_viewer_pointer_grab(VirtViewerDisplay *display G_GNUC_UNUSED,
988 VirtViewer *viewer)
989 {
990 virt_viewer_set_title(viewer, TRUE);
991 }
992
993 static void
994 virt_viewer_pointer_ungrab(VirtViewerDisplay *display G_GNUC_UNUSED,
995 VirtViewer *viewer)
996 {
997 virt_viewer_set_title(viewer, FALSE);
998 }
999
1000 static void
1001 virt_viewer_keyboard_grab(VirtViewerDisplay *display G_GNUC_UNUSED,
1002 VirtViewer *viewer)
1003 {
1004 virt_viewer_disable_modifiers(viewer);
1005 }
1006
1007 static void
1008 virt_viewer_keyboard_ungrab(VirtViewerDisplay *display G_GNUC_UNUSED,
1009 VirtViewer *viewer)
1010 {
1011 virt_viewer_enable_modifiers(viewer);
1012 }
1013
1014
1015 static void
1016 virt_viewer_display_added(VirtViewerSession *session G_GNUC_UNUSED,
1017 VirtViewerDisplay *display,
1018 VirtViewer *viewer)
1019 {
1020 /* XXX multihead */
1021 if (viewer->display)
1022 return;
1023 viewer->display = GTK_WIDGET(display);
1024
1025 g_signal_connect(viewer->display, "display-pointer-grab",
1026 G_CALLBACK(virt_viewer_pointer_grab), viewer);
1027 g_signal_connect(viewer->display, "display-pointer-ungrab",
1028 G_CALLBACK(virt_viewer_pointer_ungrab), viewer);
1029 g_signal_connect(viewer->display, "display-keyboard-grab",
1030 G_CALLBACK(virt_viewer_keyboard_grab), viewer);
1031 g_signal_connect(viewer->display, "display-keyboard-ungrab",
1032 G_CALLBACK(virt_viewer_keyboard_ungrab), viewer);
1033
1034 g_signal_connect(viewer->display, "display-desktop-resize",
1035 G_CALLBACK(virt_viewer_desktop_resize), viewer);
1036
1037 gtk_notebook_append_page(GTK_NOTEBOOK(viewer->notebook), viewer->display, NULL);
1038 if (gtk_bin_get_child(GTK_BIN(viewer->display)))
1039 gtk_widget_realize(GTK_WIDGET(gtk_bin_get_child(GTK_BIN(viewer->display))));
1040 gtk_widget_show_all(viewer->display);
1041 }
1042
1043 static void
1044 virt_viewer_display_removed(VirtViewerSession *session G_GNUC_UNUSED,
1045 VirtViewerDisplay *display,
1046 VirtViewer *viewer)
1047 {
1048 /* XXX multihead */
1049 if (viewer->display != GTK_WIDGET(display))
1050 return;
1051
1052 gtk_widget_hide(GTK_WIDGET(display));
1053 gtk_notebook_remove_page(GTK_NOTEBOOK(viewer->notebook), 1);
1054 viewer->display = NULL;
1055 }
1056
1057 static void
1058 virt_viewer_connect_info_free(VirtViewer *viewer)
1059 {
1060 free(viewer->host);
1061 free(viewer->ghost);
1062 free(viewer->gport);
1063 free(viewer->transport);
1064 free(viewer->user);
1065 free(viewer->unixsock);
1066
1067 viewer->host = NULL;
1068 viewer->ghost = NULL;
1069 viewer->gport = NULL;
1070 viewer->transport = NULL;
1071 viewer->user = NULL;
1072 viewer->unixsock = NULL;
1073 viewer->port = 0;
1074 }
1075
1076 static gboolean
1077 virt_viewer_extract_connect_info(VirtViewer *viewer,
1078 virDomainPtr dom)
1079 {
1080 char *type = NULL;
1081 char *xpath = NULL;
1082 gboolean retval = FALSE;
1083 char *xmldesc = virDomainGetXMLDesc(dom, 0);
1084
1085 virt_viewer_connect_info_free(viewer);
1086
1087 if ((type = virt_viewer_extract_xpath_string(xmldesc, "string(/domain/devices/graphics/@type)")) == NULL) {
1088 virt_viewer_simple_message_dialog(viewer->window, _("Cannot determine the graphic type for the guest %s"),
1089 viewer->domkey);
1090 goto cleanup;
1091 }
1092
1093 if (g_strcasecmp(type, "vnc") == 0) {
1094 virt_viewer_trace(viewer, "Guest %s has a %s display\n",
1095 viewer->domkey, type);
1096 viewer->session = virt_viewer_session_vnc_new();
1097 #ifdef HAVE_SPICE_GTK
1098 } else if (g_strcasecmp(type, "spice") == 0) {
1099 virt_viewer_trace(viewer, "Guest %s has a %s display\n",
1100 viewer->domkey, type);
1101 viewer->session = virt_viewer_session_spice_new();
1102 #endif
1103 } else {
1104 virt_viewer_trace(viewer, "Guest %s has unsupported %s display type\n",
1105 viewer->domkey, type);
1106 virt_viewer_simple_message_dialog(viewer->window, _("Unknown graphic type for the guest %s"),
1107 viewer->domkey);
1108 goto cleanup;
1109 }
1110
1111 g_signal_connect(viewer->session, "session-initialized",
1112 G_CALLBACK(virt_viewer_initialized), viewer);
1113 g_signal_connect(viewer->session, "session-connected",
1114 G_CALLBACK(virt_viewer_connected), viewer);
1115 g_signal_connect(viewer->session, "session-disconnected",
1116 G_CALLBACK(virt_viewer_disconnected), viewer);
1117 g_signal_connect(viewer->session, "session-channel-open",
1118 G_CALLBACK(virt_viewer_channel_open), viewer);
1119 g_signal_connect(viewer->session, "session-auth-refused",
1120 G_CALLBACK(virt_viewer_auth_refused), viewer);
1121 g_signal_connect(viewer->session, "session-auth-failed",
1122 G_CALLBACK(virt_viewer_auth_failed), viewer);
1123 g_signal_connect(viewer->session, "session-display-added",
1124 G_CALLBACK(virt_viewer_display_added), viewer);
1125 g_signal_connect(viewer->session, "session-display-removed",
1126 G_CALLBACK(virt_viewer_display_removed), viewer);
1127
1128 g_signal_connect(viewer->session, "session-cut-text",
1129 G_CALLBACK(virt_viewer_server_cut_text), viewer);
1130 g_signal_connect(viewer->session, "session-bell",
1131 G_CALLBACK(virt_viewer_bell), viewer);
1132
1133 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@port)", type);
1134 if ((viewer->gport = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) {
1135 free(xpath);
1136 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@socket)", type);
1137 if ((viewer->unixsock = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) {
1138 virt_viewer_simple_message_dialog(viewer->window, _("Cannot determine the graphic address for the guest %s"),
1139 viewer->domkey);
1140 goto cleanup;
1141 }
1142 } else {
1143 free(xpath);
1144 xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@listen)", type);
1145 viewer->ghost = virt_viewer_extract_xpath_string(xmldesc, xpath);
1146 if (viewer->ghost == NULL)
1147 viewer->ghost = g_strdup("localhost");
1148 }
1149
1150 if (viewer->gport)
1151 DEBUG_LOG("Guest graphics address is %s:%s", viewer->ghost, viewer->gport);
1152 else
1153 DEBUG_LOG("Guest graphics address is %s", viewer->unixsock);
1154
1155 if (virt_viewer_extract_host(viewer->uri, &viewer->host, &viewer->transport, &viewer->user, &viewer->port) < 0) {
1156 virt_viewer_simple_message_dialog(viewer->window, _("Cannot determine the host for the guest %s"),
1157 viewer->domkey);
1158 goto cleanup;
1159 }
1160
1161 retval = TRUE;
1162
1163 cleanup:
1164 g_free(type);
1165 g_free(xpath);
1166 g_free(xmldesc);
1167 return retval;
1168 }
1169
1170 #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
1171 static void
1172 virt_viewer_channel_open(VirtViewerSession *session,
1173 VirtViewerSessionChannel *channel,
1174 VirtViewer *viewer)
1175 {
1176 int fd = -1;
1177
1178 g_return_if_fail(viewer != NULL);
1179
1180 if (viewer->transport && g_strcasecmp(viewer->transport, "ssh") == 0 &&
1181 !viewer->direct) {
1182 if ((fd = virt_viewer_open_tunnel_ssh(viewer->host, viewer->port, viewer->user,
1183 viewer->ghost, viewer->gport, NULL)) < 0)
1184 virt_viewer_simple_message_dialog(viewer->window, _("Connect to ssh failed."));
1185 } else {
1186 virt_viewer_simple_message_dialog(viewer->window, _("Can't connect to channel, SSH only supported."));
1187 }
1188
1189 if (fd >= 0)
1190 virt_viewer_session_channel_open_fd(session, channel, fd);
1191 }
1192 #else
1193 static void
1194 virt_viewer_channel_open(VirtViewerSession *session G_GNUC_UNUSED,
1195 VirtViewerSessionChannel *channel G_GNUC_UNUSED,
1196 VirtViewer *viewer)
1197 {
1198 virt_viewer_simple_message_dialog(viewer->window, _("Connect to channel unsupported."));
1199 }
1200 #endif
1201
1202 static int
1203 virt_viewer_activate(VirtViewer *viewer,
1204 virDomainPtr dom)
1205 {
1206 int fd = -1;
1207 int ret = -1;
1208
1209 if (viewer->active)
1210 goto cleanup;
1211
1212 virt_viewer_trace(viewer, "Guest %s is running, determining display\n",
1213 viewer->domkey);
1214 if (viewer->session == NULL) {
1215 if (!virt_viewer_extract_connect_info(viewer, dom))
1216 goto cleanup;
1217
1218 if (viewer->gport)
1219 viewer->pretty_address = g_strdup_printf("%s:%s", viewer->ghost, viewer->gport);
1220 else
1221 viewer->pretty_address = g_strdup_printf("%s:%s", viewer->host, viewer->unixsock);
1222 }
1223
1224 #if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
1225 if (viewer->transport &&
1226 g_strcasecmp(viewer->transport, "ssh") == 0 &&
1227 !viewer->direct) {
1228 if (viewer->gport) {
1229 virt_viewer_trace(viewer, "Opening indirect TCP connection to display at %s:%s\n",
1230 viewer->ghost, viewer->gport);
1231 } else {
1232 virt_viewer_trace(viewer, "Opening indirect UNIX connection to display at %s\n",
1233 viewer->unixsock);
1234 }
1235 virt_viewer_trace(viewer, "Setting up SSH tunnel via %s@%s:%d\n",
1236 viewer->user, viewer->host, viewer->port ? viewer->port : 22);
1237
1238 if ((fd = virt_viewer_open_tunnel_ssh(viewer->host, viewer->port,
1239 viewer->user, viewer->ghost,
1240 viewer->gport, viewer->unixsock)) < 0)
1241 return -1;
1242 } else if (viewer->unixsock) {
1243 virt_viewer_trace(viewer, "Opening direct UNIX connection to display at %s",
1244 viewer->unixsock);
1245 if ((fd = virt_viewer_open_unix_sock(viewer->unixsock)) < 0)
1246 return -1;
1247 }
1248 #endif
1249
1250 if (fd >= 0) {
1251 ret = virt_viewer_session_open_fd(VIRT_VIEWER_SESSION(viewer->session), fd);
1252 } else {
1253 virt_viewer_trace(viewer, "Opening direct TCP connection to display at %s:%s\n",
1254 viewer->ghost, viewer->gport);
1255 ret = virt_viewer_session_open_host(VIRT_VIEWER_SESSION(viewer->session),
1256 viewer->ghost, viewer->gport);
1257 }
1258
1259 virt_viewer_set_status(viewer, "Connecting to graphic server");
1260
1261 viewer->connected = FALSE;
1262 viewer->active = TRUE;
1263 virt_viewer_set_title(viewer, FALSE);
1264
1265 cleanup:
1266 return ret;
1267 }
1268
1269 /* text was actually requested */
1270 static void
1271 virt_viewer_clipboard_copy(GtkClipboard *clipboard G_GNUC_UNUSED,
1272 GtkSelectionData *data,
1273 guint info G_GNUC_UNUSED,
1274 VirtViewer *viewer)
1275 {
1276 gtk_selection_data_set_text(data, viewer->clipboard, -1);
1277 }
1278
1279 static void
1280 virt_viewer_server_cut_text(VirtViewerSession *session G_GNUC_UNUSED,
1281 const gchar *text,
1282 VirtViewer *viewer)
1283 {
1284 GtkClipboard *cb;
1285 gsize a, b;
1286 GtkTargetEntry targets[] = {
1287 {g_strdup("UTF8_STRING"), 0, 0},
1288 {g_strdup("COMPOUND_TEXT"), 0, 0},
1289 {g_strdup("TEXT"), 0, 0},
1290 {g_strdup("STRING"), 0, 0},
1291 };
1292
1293 if (!text)
1294 return;
1295
1296 g_free (viewer->clipboard);
1297 viewer->clipboard = g_convert (text, -1, "utf-8", "iso8859-1", &a, &b, NULL);
1298
1299 if (viewer->clipboard) {
1300 cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
1301
1302 gtk_clipboard_set_with_owner (cb,
1303 targets,
1304 G_N_ELEMENTS(targets),
1305 (GtkClipboardGetFunc)virt_viewer_clipboard_copy,
1306 NULL,
1307 G_OBJECT (viewer));
1308 }
1309 }
1310
1311
1312 static void virt_viewer_bell(VirtViewerSession *session G_GNUC_UNUSED,
1313 VirtViewer *viewer)
1314 {
1315 gdk_window_beep(gtk_widget_get_window(GTK_WIDGET(viewer->window)));
1316 }
1317
1318
1319 static gboolean
1320 virt_viewer_retryauth(gpointer opaque)
1321 {
1322 VirtViewer *viewer = opaque;
1323 virt_viewer_initial_connect(viewer);
1324
1325 return FALSE;
1326 }
1327
1328 static void
1329 virt_viewer_deactivate(VirtViewer *viewer)
1330 {
1331 if (!viewer->active)
1332 return;
1333
1334 if (viewer->session)
1335 virt_viewer_session_close(VIRT_VIEWER_SESSION(viewer->session));
1336
1337 viewer->connected = FALSE;
1338 viewer->active = FALSE;
1339 #if 0
1340 g_free(viewer->pretty_address);
1341 viewer->pretty_address = NULL;
1342 #endif
1343 virt_viewer_set_title(viewer, FALSE);
1344
1345 if (viewer->authretry) {
1346 viewer->authretry = FALSE;
1347 g_idle_add(virt_viewer_retryauth, viewer);
1348 } else if (viewer->reconnect) {
1349 if (!viewer->withEvents) {
1350 DEBUG_LOG("No domain events, falling back to polling");
1351 g_timeout_add(500,
1352 virt_viewer_connect_timer,
1353 viewer);
1354 }
1355
1356 virt_viewer_set_status(viewer, "Waiting for guest domain to re-start");
1357 virt_viewer_trace(viewer, "Guest %s display has disconnected, waiting to reconnect",
1358 viewer->domkey);
1359 } else {
1360 virt_viewer_set_status(viewer, "Guest domain has shutdown");
1361 virt_viewer_trace(viewer, "Guest %s display has disconnected, shutting down",
1362 viewer->domkey);
1363 gtk_main_quit();
1364 }
1365 }
1366
1367 static void
1368 virt_viewer_connected(VirtViewerSession *session G_GNUC_UNUSED,
1369 VirtViewer *viewer)
1370 {
1371 viewer->connected = TRUE;
1372 virt_viewer_set_status(viewer, "Connected to graphic server");
1373 }
1374
1375 static void
1376 virt_viewer_initialized(VirtViewerSession *session G_GNUC_UNUSED,
1377 VirtViewer *viewer)
1378 {
1379 virt_viewer_show_display(viewer);
1380 virt_viewer_set_title(viewer, FALSE);
1381 }
1382
1383 static void
1384 virt_viewer_disconnected(VirtViewerSession *session G_GNUC_UNUSED,
1385 VirtViewer *viewer)
1386 {
1387 if (!viewer->connected) {
1388 virt_viewer_simple_message_dialog(viewer->window,
1389 _("Unable to connect to the graphic server %s"),
1390 viewer->pretty_address);
1391 }
1392 virt_viewer_deactivate(viewer);
1393 }
1394
1395
1396 static void virt_viewer_auth_refused(VirtViewerSession *session G_GNUC_UNUSED,
1397 const char *msg,
1398 VirtViewer *viewer)
1399 {
1400 GtkWidget *dialog;
1401 int ret;
1402
1403 dialog = gtk_message_dialog_new(GTK_WINDOW(viewer->window),
1404 GTK_DIALOG_MODAL |
1405 GTK_DIALOG_DESTROY_WITH_PARENT,
1406 GTK_MESSAGE_ERROR,
1407 GTK_BUTTONS_YES_NO,
1408 _("Unable to authenticate with remote desktop server at %s: %s\n"
1409 "Retry connection again?"),
1410 viewer->pretty_address, msg);
1411
1412 ret = gtk_dialog_run(GTK_DIALOG(dialog));
1413
1414 gtk_widget_destroy(dialog);
1415
1416 if (ret == GTK_RESPONSE_YES)
1417 viewer->authretry = TRUE;
1418 else
1419 viewer->authretry = FALSE;
1420 }
1421
1422
1423 static void virt_viewer_auth_failed(VirtViewerSession *session G_GNUC_UNUSED,
1424 const char *msg,
1425 VirtViewer *viewer)
1426 {
1427 virt_viewer_simple_message_dialog(viewer->window,
1428 _("Unable to authenticate with remote desktop server at %s"),
1429 viewer->pretty_address, msg);
1430 }
1431
1432
1433 static int
1434 virt_viewer_domain_event(virConnectPtr conn G_GNUC_UNUSED,
1435 virDomainPtr dom,
1436 int event,
1437 int detail G_GNUC_UNUSED,
1438 void *opaque)
1439 {
1440 VirtViewer *viewer = opaque;
1441
1442 DEBUG_LOG("Got domain event %d %d", event, detail);
1443
1444 if (!virt_viewer_matches_domain(viewer, dom))
1445 return 0;
1446
1447 switch (event) {
1448 case VIR_DOMAIN_EVENT_STOPPED:
1449 //virt_viewer_deactivate(viewer);
1450 break;
1451
1452 case VIR_DOMAIN_EVENT_STARTED:
1453 virt_viewer_activate(viewer, dom);
1454 break;
1455 }
1456
1457 return 0;
1458 }
1459
1460
1461 static int
1462 virt_viewer_initial_connect(VirtViewer *viewer)
1463 {
1464 virDomainPtr dom = NULL;
1465 virDomainInfo info;
1466 int ret = -1;
1467
1468 virt_viewer_set_status(viewer, "Finding guest domain");
1469 dom = virt_viewer_lookup_domain(viewer);
1470 if (!dom) {
1471 if (viewer->waitvm) {
1472 virt_viewer_set_status(viewer, "Waiting for guest domain to be created");
1473 virt_viewer_trace(viewer, "Guest %s does not yet exist, waiting for it to be created\n",
1474 viewer->domkey);
1475 goto done;
1476 } else {
1477 virt_viewer_simple_message_dialog(viewer->window, _("Cannot find guest domain %s"),
1478 viewer->domkey);
1479 DEBUG_LOG("Cannot find guest %s", viewer->domkey);
1480 goto cleanup;
1481 }
1482 }
1483
1484 free(viewer->domtitle);
1485 viewer->domtitle = g_strdup(virDomainGetName(dom));
1486
1487 virt_viewer_set_status(viewer, "Checking guest domain status");
1488 if (virDomainGetInfo(dom, &info) < 0) {
1489 DEBUG_LOG("Cannot get guest state");
1490 goto cleanup;
1491 }
1492
1493 if (info.state == VIR_DOMAIN_SHUTOFF) {
1494 virt_viewer_set_status(viewer, "Waiting for guest domain to start");
1495 } else {
1496 ret = virt_viewer_activate(viewer, dom);
1497 if (ret < 0) {
1498 if (viewer->waitvm) {
1499 virt_viewer_set_status(viewer, "Waiting for guest domain to start server");
1500 virt_viewer_trace(viewer, "Guest %s has not activated its display yet, waiting for it to start\n",
1501 viewer->domkey);
1502 } else {
1503 DEBUG_LOG("Failed to activate viewer");
1504 goto cleanup;
1505 }
1506 } else if (ret == 0) {
1507 DEBUG_LOG("Failed to activate viewer");
1508 ret = -1;
1509 goto cleanup;
1510 }
1511 }
1512
1513 done:
1514 ret = 0;
1515 cleanup:
1516 if (dom)
1517 virDomainFree(dom);
1518 return ret;
1519 }
1520
1521 static gboolean
1522 virt_viewer_connect_timer(void *opaque)
1523 {
1524 VirtViewer *viewer = opaque;
1525
1526 DEBUG_LOG("Connect timer fired");
1527
1528 if (!viewer->active &&
1529 virt_viewer_initial_connect(viewer) < 0)
1530 gtk_main_quit();
1531
1532 if (viewer->active)
1533 return FALSE;
1534
1535 return TRUE;
1536 }
1537
1538 static void
1539 virt_viewer_toolbar_setup(VirtViewer *viewer)
1540 {
1541 GtkWidget *button;
1542
1543 viewer->toolbar = gtk_toolbar_new();
1544 gtk_toolbar_set_show_arrow(GTK_TOOLBAR(viewer->toolbar), FALSE);
1545 gtk_widget_set_no_show_all(viewer->toolbar, TRUE);
1546 gtk_toolbar_set_style(GTK_TOOLBAR(viewer->toolbar), GTK_TOOLBAR_BOTH_HORIZ);
1547
1548 /* Close connection */
1549 button = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_CLOSE));
1550 gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("Disconnect"));
1551 gtk_widget_show(GTK_WIDGET(button));
1552 gtk_toolbar_insert(GTK_TOOLBAR(viewer->toolbar), GTK_TOOL_ITEM (button), 0);
1553 g_signal_connect(button, "clicked", G_CALLBACK(gtk_main_quit), NULL);
1554
1555 /* Leave fullscreen */
1556 button = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_LEAVE_FULLSCREEN));
1557 gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), _("Leave fullscreen"));
1558 gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("Leave fullscreen"));
1559 gtk_tool_item_set_is_important(GTK_TOOL_ITEM(button), TRUE);
1560 gtk_widget_show(GTK_WIDGET(button));
1561 gtk_toolbar_insert(GTK_TOOLBAR(viewer->toolbar), GTK_TOOL_ITEM(button), 0);
1562 g_signal_connect(button, "clicked", G_CALLBACK(virt_viewer_toolbar_leave_fullscreen), viewer);
1563
1564 viewer->layout = ViewAutoDrawer_New();
1565
1566 ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(viewer->layout), FALSE);
1567 ViewOvBox_SetOver(VIEW_OV_BOX(viewer->layout), viewer->toolbar);
1568 ViewOvBox_SetUnder(VIEW_OV_BOX(viewer->layout), viewer->notebook);
1569 ViewAutoDrawer_SetOffset(VIEW_AUTODRAWER(viewer->layout), -1);
1570 ViewAutoDrawer_SetFill(VIEW_AUTODRAWER(viewer->layout), FALSE);
1571 ViewAutoDrawer_SetOverlapPixels(VIEW_AUTODRAWER(viewer->layout), 1);
1572 ViewAutoDrawer_SetNoOverlapPixels(VIEW_AUTODRAWER(viewer->layout), 0);
1573 }
1574
1575
1576 static void
1577 virt_viewer_error_func (void *data G_GNUC_UNUSED,
1578 virErrorPtr error G_GNUC_UNUSED)
1579 {
1580 /* nada */
1581 }
1582
1583 int
1584 virt_viewer_start(const char *uri,
1585 const char *name,
1586 gint zoom,
1587 gboolean direct,
1588 gboolean waitvm,
1589 gboolean reconnect,
1590 gboolean verbose,
1591 gboolean debug,
1592 gboolean fullscreen,
1593 GtkWidget *container)
1594 {
1595 VirtViewer *viewer;
1596 GtkWidget *menu;
1597 int cred_types[] =
1598 { VIR_CRED_AUTHNAME, VIR_CRED_PASSPHRASE };
1599 virConnectAuth auth_libvirt = {
1600 .credtype = cred_types,
1601 .ncredtype = ARRAY_CARDINALITY(cred_types),
1602 .cb = virt_viewer_auth_libvirt_credentials,
1603 .cbdata = (void *)uri,
1604 };
1605 GdkColor color;
1606 doDebug = debug;
1607
1608 viewer = g_new0(VirtViewer, 1);
1609
1610 viewer->active = FALSE;
1611 viewer->autoResize = TRUE;
1612 viewer->direct = direct;
1613 viewer->waitvm = waitvm;
1614 viewer->reconnect = reconnect;
1615 viewer->verbose = verbose;
1616 viewer->domkey = g_strdup(name);
1617 viewer->uri = g_strdup(uri);
1618
1619 g_value_init(&viewer->accelSetting, G_TYPE_STRING);
1620
1621 virt_viewer_events_register();
1622
1623 virSetErrorFunc(NULL, virt_viewer_error_func);
1624
1625 virt_viewer_trace(viewer, "Opening connection to libvirt with URI %s\n",
1626 uri ? uri : "<null>");
1627 viewer->conn = virConnectOpenAuth(uri,
1628 //virConnectAuthPtrDefault,
1629 &auth_libvirt,
1630 VIR_CONNECT_RO);
1631 if (!viewer->conn) {
1632 virt_viewer_simple_message_dialog(NULL, _("Unable to connect to libvirt with URI %s"),
1633 uri ? uri : _("[none]"));
1634 return -1;
1635 }
1636
1637 if (!container) {
1638 viewer->builder = virt_viewer_util_load_ui("virt-viewer.xml");
1639
1640 menu = GTK_WIDGET(gtk_builder_get_object(viewer->builder, "menu-view-resize"));
1641 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
1642
1643 gtk_builder_connect_signals(viewer->builder, viewer);
1644 }
1645
1646 viewer->status = gtk_label_new("");
1647
1648 viewer->zoomlevel = zoom;
1649
1650 viewer->notebook = gtk_notebook_new();
1651 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(viewer->notebook), FALSE);
1652 gtk_notebook_set_show_border(GTK_NOTEBOOK(viewer->notebook), FALSE);
1653
1654 gtk_notebook_append_page(GTK_NOTEBOOK(viewer->notebook), viewer->status, NULL);
1655
1656 if (container) {
1657 viewer->container = container;
1658
1659 gtk_box_pack_end(GTK_BOX(container), viewer->notebook, TRUE, TRUE, 0);
1660 gtk_widget_show_all(GTK_WIDGET(container));
1661 } else {
1662 GtkWidget *vbox = GTK_WIDGET(gtk_builder_get_object(viewer->builder, "viewer-box"));
1663 virt_viewer_toolbar_setup(viewer);
1664
1665 gtk_box_pack_end(GTK_BOX(vbox), viewer->layout, TRUE, TRUE, 0);
1666 gdk_color_parse("black", &color);
1667 gtk_widget_modify_bg(viewer->layout, GTK_STATE_NORMAL, &color);
1668 gdk_color_parse("white", &color);
1669 gtk_widget_modify_fg(viewer->status, GTK_STATE_NORMAL, &color);
1670
1671 GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(viewer->builder, "viewer"));
1672 GSList *accels;
1673 viewer->container = window;
1674 viewer->window = window;
1675 virt_viewer_set_title(viewer, FALSE);
1676 gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
1677 #if GTK_CHECK_VERSION(3, 0, 0)
1678 gtk_window_set_has_resize_grip(GTK_WINDOW(window), FALSE);
1679 #endif
1680 viewer->accelEnabled = TRUE;
1681 accels = gtk_accel_groups_from_object(G_OBJECT(window));
1682 for ( ; accels ; accels = accels->next) {
1683 viewer->accelList = g_slist_append(viewer->accelList, accels->data);
1684 g_object_ref(G_OBJECT(accels->data));
1685 }
1686 g_signal_connect(G_OBJECT(window), "window-state-event", G_CALLBACK(window_state_cb), viewer);
1687 if (fullscreen)
1688 gtk_window_fullscreen(GTK_WINDOW(window));
1689 gtk_widget_show_all(viewer->window);
1690 }
1691
1692 if (virt_viewer_initial_connect(viewer) < 0)
1693 return -1;
1694
1695 if (virConnectDomainEventRegister(viewer->conn,
1696 virt_viewer_domain_event,
1697 viewer,
1698 NULL) < 0)
1699 viewer->withEvents = FALSE;
1700 else
1701 viewer->withEvents = TRUE;
1702
1703 if (!viewer->withEvents &&
1704 !viewer->active) {
1705 DEBUG_LOG("No domain events, falling back to polling");
1706 g_timeout_add(500,
1707 virt_viewer_connect_timer,
1708 viewer);
1709 }
1710
1711 return 0;
1712 }
1713
1714
1715 /*
1716 * Local variables:
1717 * c-indent-level: 8
1718 * c-basic-offset: 8
1719 * tab-width: 8
1720 * indent-tabs-mode: t
1721 * End:
1722 */
0 /*
1 * Virt Viewer: A virtual machine console viewer
2 *
3 * Copyright (C) 2007 Red Hat,
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Daniel P. Berrange <berrange@redhat.com>
20 */
21
22 #ifndef VIRT_VIEWER_H
23 #define VIRT_VIEWER_H
24
25 #include "virt-viewer-util.h"
26
27 typedef struct _VirtViewer VirtViewer;
28
29 extern int virt_viewer_start(const char *uri,
30 const char *name,
31 gint zoom,
32 gboolean direct,
33 gboolean waitvm,
34 gboolean reconnect,
35 gboolean verbose,
36 gboolean debug,
37 gboolean fullscreen,
38 GtkWidget *container);
39
40 #endif /* VIRT_VIEWER_H */
0 <?xml version="1.0"?>
1 <interface>
2 <!-- interface-requires gtk+ 2.6 -->
3 <!-- interface-naming-policy toplevel-contextual -->
4 <object class="GtkWindow" id="viewer">
5 <property name="default_width">400</property>
6 <property name="default_height">400</property>
7 <signal name="delete_event" handler="virt_viewer_delete"/>
8 <child>
9 <object class="GtkVBox" id="viewer-box">
10 <property name="visible">True</property>
11 <property name="orientation">vertical</property>
12 <child>
13 <object class="GtkMenuBar" id="top-menu">
14 <property name="visible">True</property>
15 <child>
16 <object class="GtkMenuItem" id="menu-file">
17 <property name="visible">True</property>
18 <property name="label" translatable="yes">_File</property>
19 <property name="use_underline">True</property>
20 <child type="submenu">
21 <object class="GtkMenu" id="menu1">
22 <property name="visible">True</property>
23 <child>
24 <object class="GtkMenuItem" id="menu-file-screenshot">
25 <property name="visible">True</property>
26 <property name="label" translatable="yes">Screenshot</property>
27 <property name="use_underline">True</property>
28 <signal name="activate" handler="virt_viewer_menu_file_screenshot"/>
29 </object>
30 </child>
31 <child>
32 <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
33 <property name="visible">True</property>
34 </object>
35 </child>
36 <child>
37 <object class="GtkImageMenuItem" id="imagemenuitem5">
38 <property name="label">gtk-quit</property>
39 <property name="visible">True</property>
40 <property name="use_underline">True</property>
41 <property name="use_stock">True</property>
42 <signal name="activate" handler="virt_viewer_menu_file_quit"/>
43 <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK|GDK_SHIFT_MASK"/>
44 </object>
45 </child>
46 </object>
47 </child>
48 </object>
49 </child>
50 <child>
51 <object class="GtkMenuItem" id="menu-view">
52 <property name="visible">True</property>
53 <property name="label" translatable="yes">_View</property>
54 <property name="use_underline">True</property>
55 <child type="submenu">
56 <object class="GtkMenu" id="menu2">
57 <property name="visible">True</property>
58 <child>
59 <object class="GtkCheckMenuItem" id="menu-view-fullscreen">
60 <property name="visible">True</property>
61 <property name="label" translatable="yes">Full screen</property>
62 <property name="use_underline">True</property>
63 <accelerator key="F11" signal="activate"/>
64 <signal name="toggled" handler="virt_viewer_menu_view_fullscreen"/>
65 </object>
66 </child>
67 <child>
68 <object class="GtkMenuItem" id="menu-view-zoom">
69 <property name="visible">True</property>
70 <property name="label" translatable="yes">_Zoom</property>
71 <property name="use_underline">True</property>
72 <child type="submenu">
73 <object class="GtkMenu" id="menu4">
74 <property name="visible">True</property>
75 <child>
76 <object class="GtkImageMenuItem" id="menu-view-zoom-in">
77 <property name="visible">True</property>
78 <property name="label">gtk-zoom-in</property>
79 <property name="use_underline">True</property>
80 <property name="use_stock">True</property>
81 <accelerator key="plus" signal="activate" modifiers="GDK_CONTROL_MASK"/>
82 <signal name="activate" handler="virt_viewer_menu_view_zoom_in"/>
83 </object>
84 </child>
85 <child>
86 <object class="GtkImageMenuItem" id="menu-view-zoom-out">
87 <property name="visible">True</property>
88 <property name="label">gtk-zoom-out</property>
89 <property name="use_underline">True</property>
90 <property name="use_stock">True</property>
91 <accelerator key="minus" signal="activate" modifiers="GDK_CONTROL_MASK"/>
92 <signal name="activate" handler="virt_viewer_menu_view_zoom_out"/>
93 </object>
94 </child>
95 <child>
96 <object class="GtkSeparatorMenuItem" id="separatormenuitem4">
97 <property name="visible">True</property>
98 </object>
99 </child>
100 <child>
101 <object class="GtkImageMenuItem" id="menu-view-zoom-reset">
102 <property name="visible">True</property>
103 <property name="label">gtk-zoom-100</property>
104 <property name="use_underline">True</property>
105 <property name="use_stock">True</property>
106 <accelerator key="0" signal="activate" modifiers="GDK_CONTROL_MASK"/>
107 <signal name="activate" handler="virt_viewer_menu_view_zoom_reset"/>
108 </object>
109 </child>
110 </object>
111 </child>
112 </object>
113 </child>
114 <child>
115 <object class="GtkCheckMenuItem" id="menu-view-resize">
116 <property name="visible">True</property>
117 <property name="label" translatable="yes">Automatically resize</property>
118 <property name="use_underline">True</property>
119 <signal name="toggled" handler="virt_viewer_menu_view_resize"/>
120 </object>
121 </child>
122 </object>
123 </child>
124 </object>
125 </child>
126 <child>
127 <object class="GtkMenuItem" id="menu-send">
128 <property name="visible">True</property>
129 <property name="label" translatable="yes">_Send key</property>
130 <property name="use_underline">True</property>
131 <child type="submenu">
132 <object class="GtkMenu" id="menu5">
133 <property name="visible">True</property>
134 <child>
135 <object class="GtkMenuItem" id="menu-send-cad">
136 <property name="visible">True</property>
137 <property name="label" translatable="yes">Ctrl+Alt+_Del</property>
138 <property name="use_underline">True</property>
139 <signal name="activate" handler="virt_viewer_menu_send"/>
140 </object>
141 </child>
142 <child>
143 <object class="GtkMenuItem" id="menu-send-cab">
144 <property name="visible">True</property>
145 <property name="label" translatable="yes">Ctrl+Alt+_Backspace</property>
146 <property name="use_underline">True</property>
147 <signal name="activate" handler="virt_viewer_menu_send"/>
148 </object>
149 </child>
150 <child>
151 <object class="GtkSeparatorMenuItem" id="separatormenuitem2">
152 <property name="visible">True</property>
153 </object>
154 </child>
155 <child>
156 <object class="GtkMenuItem" id="menu-send-caf1">
157 <property name="visible">True</property>
158 <property name="label" translatable="yes">Ctrl+Alt+F_1</property>
159 <property name="use_underline">True</property>
160 <signal name="activate" handler="virt_viewer_menu_send"/>
161 </object>
162 </child>
163 <child>
164 <object class="GtkMenuItem" id="menu-send-caf2">
165 <property name="visible">True</property>
166 <property name="label" translatable="yes">Ctrl+Alt+F_2</property>
167 <property name="use_underline">True</property>
168 <signal name="activate" handler="virt_viewer_menu_send"/>
169 </object>
170 </child>
171 <child>
172 <object class="GtkMenuItem" id="menu-send-caf3">
173 <property name="visible">True</property>
174 <property name="label" translatable="yes">Ctrl+Alt+F_3</property>
175 <property name="use_underline">True</property>
176 <signal name="activate" handler="virt_viewer_menu_send"/>
177 </object>
178 </child>
179 <child>
180 <object class="GtkMenuItem" id="menu-send-caf4">
181 <property name="visible">True</property>
182 <property name="label" translatable="yes">Ctrl+Alt+F_4</property>
183 <property name="use_underline">True</property>
184 <signal name="activate" handler="virt_viewer_menu_send"/>
185 </object>
186 </child>
187 <child>
188 <object class="GtkMenuItem" id="menu-send-caf5">
189 <property name="visible">True</property>
190 <property name="label" translatable="yes">Ctrl+Alt+F_5</property>
191 <property name="use_underline">True</property>
192 <signal name="activate" handler="virt_viewer_menu_send"/>
193 </object>
194 </child>
195 <child>
196 <object class="GtkMenuItem" id="menu-send-caf6">
197 <property name="visible">True</property>
198 <property name="label" translatable="yes">Ctrl+Alt+F_6</property>
199 <property name="use_underline">True</property>
200 <signal name="activate" handler="virt_viewer_menu_send"/>
201 </object>
202 </child>
203 <child>
204 <object class="GtkMenuItem" id="menu-send-caf7">
205 <property name="visible">True</property>
206 <property name="label" translatable="yes">Ctrl+Alt+F_7</property>
207 <property name="use_underline">True</property>
208 <signal name="activate" handler="virt_viewer_menu_send"/>
209 </object>
210 </child>
211 <child>
212 <object class="GtkMenuItem" id="menu-send-caf8">
213 <property name="visible">True</property>
214 <property name="label" translatable="yes">Ctrl+Alt+F_8</property>
215 <property name="use_underline">True</property>
216 <signal name="activate" handler="virt_viewer_menu_send"/>
217 </object>
218 </child>
219 <child>
220 <object class="GtkMenuItem" id="menu-send-caf9">
221 <property name="visible">True</property>
222 <property name="label" translatable="yes">Ctrl+Alt+F_9</property>
223 <property name="use_underline">True</property>
224 <signal name="activate" handler="virt_viewer_menu_send"/>
225 </object>
226 </child>
227 <child>
228 <object class="GtkMenuItem" id="menu-send-caf10">
229 <property name="visible">True</property>
230 <property name="label" translatable="yes">Ctrl+Alt+F1_0</property>
231 <property name="use_underline">True</property>
232 <signal name="activate" handler="virt_viewer_menu_send"/>
233 </object>
234 </child>
235 <child>
236 <object class="GtkMenuItem" id="menu-send-caf11">
237 <property name="visible">True</property>
238 <property name="label" translatable="yes">Ctrl+Alt+F11</property>
239 <property name="use_underline">True</property>
240 <signal name="activate" handler="virt_viewer_menu_send"/>
241 </object>
242 </child>
243 <child>
244 <object class="GtkMenuItem" id="menu-send-caf12">
245 <property name="visible">True</property>
246 <property name="label" translatable="yes">Ctrl+Alt+F12</property>
247 <property name="use_underline">True</property>
248 <signal name="activate" handler="virt_viewer_menu_send"/>
249 </object>
250 </child>
251 <child>
252 <object class="GtkSeparatorMenuItem" id="separatormenuitem3">
253 <property name="visible">True</property>
254 </object>
255 </child>
256 <child>
257 <object class="GtkMenuItem" id="menu-send-print">
258 <property name="visible">True</property>
259 <property name="label" translatable="yes">_PrintScreen</property>
260 <property name="use_underline">True</property>
261 <signal name="activate" handler="virt_viewer_menu_send"/>
262 </object>
263 </child>
264 </object>
265 </child>
266 </object>
267 </child>
268 <child>
269 <object class="GtkMenuItem" id="menu-help">
270 <property name="visible">True</property>
271 <property name="label" translatable="yes">_Help</property>
272 <property name="use_underline">True</property>
273 <child type="submenu">
274 <object class="GtkMenu" id="menu3">
275 <property name="visible">True</property>
276 <child>
277 <object class="GtkImageMenuItem" id="imagemenuitem10">
278 <property name="label">gtk-about</property>
279 <property name="visible">True</property>
280 <property name="use_underline">True</property>
281 <property name="use_stock">True</property>
282 <signal name="activate" handler="virt_viewer_menu_help_about"/>
283 </object>
284 </child>
285 </object>
286 </child>
287 </object>
288 </child>
289 </object>
290 <packing>
291 <property name="expand">False</property>
292 <property name="position">0</property>
293 </packing>
294 </child>
295 </object>
296 </child>
297 </object>
298 </interface>
33 # a security audit at very least
44 %define _with_plugin %{?with_plugin:1}%{!?with_plugin:0}
55
6 %define with_gtk3 0
7 %if 0%{?fedora} >= 15
8 %define with_gtk3 1
9 %endif
10
611 %define with_spice 0
7 %if 0%{?fedora} >= 14
12 %if 0%{?fedora} >= 16
813 %define with_spice 1
914 %endif
1015
16 # spice-gtk is x86 x86_64 only currently:
17 %ifnarch %{ix86} x86_64
18 %define with_spice 0
19 %endif
20
1121 Name: virt-viewer
12 Version: 0.3.1
22 Version: 0.4.0
1323 Release: 1%{?dist}%{?extra_release}
1424 Summary: Virtual Machine Viewer
1525 Group: Applications/System
1929 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
2030 Requires: openssh-clients
2131
22 BuildRequires: gtk2-devel
32 %if %{with_gtk3}
33 BuildRequires: gtk3-devel >= 3.0.0
34 %else
35 BuildRequires: gtk2-devel >= 2.12.0
36 %endif
2337 BuildRequires: libvirt-devel >= 0.6.0
2438 BuildRequires: libxml2-devel
25 BuildRequires: libglade2-devel
39 %if %{with_gtk3}
40 BuildRequires: gtk-vnc2-devel >= 0.4.3
41 %else
2642 BuildRequires: gtk-vnc-devel >= 0.3.8
43 %endif
2744 %if %{with_spice}
28 BuildRequires: spice-gtk-devel >= 0.5
45 %if %{with_gtk3}
46 BuildRequires: spice-gtk3-devel >= 0.6
47 %else
48 BuildRequires: spice-gtk-devel >= 0.6
49 %endif
2950 %endif
3051 BuildRequires: /usr/bin/pod2man
3152 BuildRequires: intltool
3960
4061 %description
4162 Virtual Machine Viewer provides a graphical console client for connecting
42 to virtual machines. It uses the GTK-VNC widget to provide the display,
43 and libvirt for looking up VNC server details.
63 to virtual machines. It uses the GTK-VNC or SPICE-GTK widgets to provide
64 the display, and libvirt for looking up VNC/SPICE server details.
4465
4566 %if %{_with_plugin}
4667 %package plugin
4970 Requires: %{name} = %{version}
5071
5172 %description plugin
52 gtk-vnc is a VNC viewer widget for GTK. It is built using coroutines
53 allowing it to be completely asynchronous while remaining single threaded.
73 Virtual Machine Viewer provides a graphical console client for connecting
74 to virtual machines. It uses the GTK-VNC or SPICE-GTK widgets to provide
75 the display, and libvirt for looking up VNC/SPICE server details.
5476
5577 This package provides a web browser plugin for Mozilla compatible
5678 browsers.
7395 %define spice_arg --disable-spice
7496 %endif
7597
76 %configure %{spice_arg} %{plugin_arg}
98 %if %{with_gtk3}
99 %define gtk_arg --with-gtk=3.0
100 %else
101 %define gtk_arg --with-gtk=2.0
102 %endif
103
104 %configure %{spice_arg} %{plugin_arg} %{gtk_arg}
77105 %__make %{?_smp_mflags}
78106
79107
95123 %{_bindir}/%{name}
96124 %dir %{_datadir}/%{name}
97125 %dir %{_datadir}/%{name}/ui/
98 %{_datadir}/%{name}/ui/auth.glade
99 %{_datadir}/%{name}/ui/about.glade
100 %{_datadir}/%{name}/ui/viewer.glade
126 %{_datadir}/%{name}/ui/virt-viewer.xml
127 %{_datadir}/%{name}/ui/virt-viewer-auth.xml
128 %{_datadir}/%{name}/ui/virt-viewer-about.xml
101129 %{_mandir}/man1/%{name}*
102130
103131 %if %{_with_plugin}
33 # a security audit at very least
44 %define _with_plugin %{?with_plugin:1}%{!?with_plugin:0}
55
6 %define with_gtk3 0
7 %if 0%{?fedora} >= 15
8 %define with_gtk3 1
9 %endif
10
611 %define with_spice 0
7 %if 0%{?fedora} >= 14
12 %if 0%{?fedora} >= 16
813 %define with_spice 1
14 %endif
15
16 # spice-gtk is x86 x86_64 only currently:
17 %ifnarch %{ix86} x86_64
18 %define with_spice 0
919 %endif
1020
1121 Name: @PACKAGE@
1929 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
2030 Requires: openssh-clients
2131
22 BuildRequires: gtk2-devel
32 %if %{with_gtk3}
33 BuildRequires: gtk3-devel >= 3.0.0
34 %else
35 BuildRequires: gtk2-devel >= 2.12.0
36 %endif
2337 BuildRequires: libvirt-devel >= 0.6.0
2438 BuildRequires: libxml2-devel
25 BuildRequires: libglade2-devel
39 %if %{with_gtk3}
40 BuildRequires: gtk-vnc2-devel >= 0.4.3
41 %else
2642 BuildRequires: gtk-vnc-devel >= 0.3.8
43 %endif
2744 %if %{with_spice}
28 BuildRequires: spice-gtk-devel >= 0.5
45 %if %{with_gtk3}
46 BuildRequires: spice-gtk3-devel >= 0.6
47 %else
48 BuildRequires: spice-gtk-devel >= 0.6
49 %endif
2950 %endif
3051 BuildRequires: /usr/bin/pod2man
3152 BuildRequires: intltool
3960
4061 %description
4162 Virtual Machine Viewer provides a graphical console client for connecting
42 to virtual machines. It uses the GTK-VNC widget to provide the display,
43 and libvirt for looking up VNC server details.
63 to virtual machines. It uses the GTK-VNC or SPICE-GTK widgets to provide
64 the display, and libvirt for looking up VNC/SPICE server details.
4465
4566 %if %{_with_plugin}
4667 %package plugin
4970 Requires: %{name} = %{version}
5071
5172 %description plugin
52 gtk-vnc is a VNC viewer widget for GTK. It is built using coroutines
53 allowing it to be completely asynchronous while remaining single threaded.
73 Virtual Machine Viewer provides a graphical console client for connecting
74 to virtual machines. It uses the GTK-VNC or SPICE-GTK widgets to provide
75 the display, and libvirt for looking up VNC/SPICE server details.
5476
5577 This package provides a web browser plugin for Mozilla compatible
5678 browsers.
7395 %define spice_arg --disable-spice
7496 %endif
7597
76 %configure %{spice_arg} %{plugin_arg}
98 %if %{with_gtk3}
99 %define gtk_arg --with-gtk=3.0
100 %else
101 %define gtk_arg --with-gtk=2.0
102 %endif
103
104 %configure %{spice_arg} %{plugin_arg} %{gtk_arg}
77105 %__make %{?_smp_mflags}
78106
79107
95123 %{_bindir}/%{name}
96124 %dir %{_datadir}/%{name}
97125 %dir %{_datadir}/%{name}/ui/
98 %{_datadir}/%{name}/ui/auth.glade
99 %{_datadir}/%{name}/ui/about.glade
100 %{_datadir}/%{name}/ui/viewer.glade
126 %{_datadir}/%{name}/ui/virt-viewer.xml
127 %{_datadir}/%{name}/ui/virt-viewer-auth.xml
128 %{_datadir}/%{name}/ui/virt-viewer-about.xml
101129 %{_mandir}/man1/%{name}*
102130
103131 %if %{_with_plugin}